Skip to main content

owned_type

Function owned_type 

Source
pub fn owned_type(signature: &str) -> Result<Tokens>
Expand description

The owned Rust type a value of this signature is decoded into.

ยงExamples

use tokio_dbus_codegen::owned_type;

assert_eq!(owned_type("s")?.to_string()?, "String");
assert_eq!(owned_type("as")?.to_string()?, "Vec<String>");
assert_eq!(owned_type("a{sv}")?.to_string()?, "HashMap<String, Value>");
assert_eq!(owned_type("(iiay)")?.to_string()?, "(i32, i32, Vec<u8>)");