zbus 6.0.0

API for D-Bus communication and its wire format
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[test]
#[cfg(feature = "heapless")]
fn heapless_string_value() {
    use heapless::String;
    use zbus::wire::{LE, serialized::Context, to_bytes};

    let s = String::<32>::try_from("hello world!").unwrap();
    let ctxt = Context::new(LE, 0);
    let encoded = to_bytes(ctxt, &s).unwrap();
    assert_eq!(encoded.len(), 17);
    let decoded: String<32> = encoded.deserialize().unwrap().0;
    assert_eq!(&decoded, "hello world!");
}