Skip to main content

parameter_type

Function parameter_type 

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

The Rust type a client takes for an argument of this signature, which borrows where borrowing is free.

ยงExamples

use tokio_dbus_codegen::parameter_type;

assert_eq!(parameter_type("s")?.to_string()?, "&str");
assert_eq!(parameter_type("u")?.to_string()?, "u32");
assert_eq!(parameter_type("as")?.to_string()?, "&[String]");
assert_eq!(parameter_type("a{sv}")?.to_string()?, "&HashMap<String, Value>");