#registry #version #tokio-test

lwm2m-registry

A simple registry for LwM2M specification files

1 unstable release

0.1.0 Jan 15, 2025

#1976 in Parser implementations

MIT license

23KB
485 lines

This crate provides functionality to read LwM2M object specification files and use the contained information in an application. It also provides some functions to query the loaded specifications.

let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
d.push("tests/spec_files");
let registry = Registry::init(vec![d]).await.unwrap();
assert!(registry.has_object_id(3, Version::new(1, 1)));

A simple LwM2M Registry written in Rust

This crate provides functionality to read LwM2M object specification files and use the contained information in an application.

Example

use std::path::PathBuf;
use tokio_test;
use lwm2m_registry::Version;
use crate::lwm2m_registry::Registry;
tokio_test::block_on(async {
let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
d.push("tests/spec_files");
let registry = Registry::init(vec![d]).await.unwrap();
assert!(registry.has_object_id(3, Version::new(1, 1)));
})

Documentation: docs.rs/lwm2m-registry

Crate: crates.io

Dependencies

~3–11MB
~118K SLoC