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
14
15
16
17
use zbus::{ObjectPath, Variant, wire::LE};

#[test]
fn object_path_value() {
    let o = ObjectPath::try_from("/hello/world").unwrap();
    basic_type_test!(LE, o, 17, ObjectPath<'_>, 4);

    // As Variant
    let v: Variant<'_> = o.into();
    assert_eq!(v.value_signature(), "o");
    let encoded = value_test!(LE, v, 21);
    let v = encoded.deserialize::<Variant<'_>>().unwrap().0;
    assert_eq!(
        v,
        Variant::ObjectPath(ObjectPath::try_from("/hello/world").unwrap())
    );
}