#registry #specification #object #version #information #lwm2m #lw-m2m

lwm2m-registry

A simple registry for LwM2M specification files

1 unstable release

0.1.0 Jan 15, 2025

#87 in #registry

33 downloads per month

MIT license

23KB
485 lines

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


lib.rs:

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)));

Dependencies

~3–12MB
~118K SLoC