Trait tokio_dbus::Storable
source · pub trait Storable: Sealed { }
Expand description
Trait used for types which can be stored with a store()
call.
§Examples
use tokio_dbus::BodyBuf;
let mut body = BodyBuf::new();
body.store(10u16)?;
body.store("Hello World")?;
assert_eq!(body.signature(), "qs");
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
impl Storable for &str
Storable
implementation for &str
.
§Examples
use tokio_dbus::BodyBuf;
let mut body = BodyBuf::new();
body.store(10u16)?;
body.store("Hello World")?;
assert_eq!(body.signature(), "qs");
impl Storable for &[u8]
Storable
implementation for &[u8]
.
§Examples
use tokio_dbus::BodyBuf;
let mut body = BodyBuf::new();
body.store(10u16)?;
body.store(&b"abcd"[..])?;
assert_eq!(body.signature(), "qay");
impl Storable for f64
impl Storable for i16
impl Storable for i32
impl Storable for i64
impl Storable for u8
impl Storable for u16
impl Storable for u32
impl Storable for u64
impl Storable for String
Storable
implementation for String
.
§Examples
use tokio_dbus::BodyBuf;
let mut body = BodyBuf::new();
body.store(10u16)?;
body.store(String::from("Hello World"))?;
assert_eq!(body.signature(), "qs");
impl Storable for MessageType
impl Storable for Type
impl Storable for Variant
Implementors§
impl Storable for &ObjectPath
Storable
implementation for &ObjectPath
.
§Examples
use tokio_dbus::BodyBuf;
use tokio_dbus::ObjectPath;
let mut body = BodyBuf::new();
body.store(10u16)?;
body.store(ObjectPath::new("/se/tedro/DBusExample")?)?;
assert_eq!(body.signature(), "qo");
impl Storable for &Signature
Storable
implementation for &Signature
.
§Examples
use tokio_dbus::BodyBuf;
use tokio_dbus::Signature;
let mut body = BodyBuf::new();
body.store(10u16)?;
body.store(Signature::new("us")?)?;
assert_eq!(body.signature(), "qg");