pub enum Value {
Show 17 variants
Byte(u8),
Bool(bool),
Int16(i16),
Uint16(u16),
Int32(i32),
Uint32(u32),
Int64(i64),
Uint64(u64),
Double(f64),
Str(String),
ObjectPath(String),
Signature(String),
UnixFd(u32),
Array {
element: String,
items: Vec<Value>,
},
Struct(Vec<Value>),
Variant(Box<Value>),
DictEntry(Box<Value>, Box<Value>),
}Expand description
A D-Bus value.
Variants§
Byte(u8)
Bool(bool)
Int16(i16)
Uint16(u16)
Int32(i32)
Uint32(u32)
Int64(i64)
Uint64(u64)
Double(f64)
Str(String)
s
ObjectPath(String)
o — syntactically a string, semantically a path.
Signature(String)
g
UnixFd(u32)
h — an index into the message’s file-descriptor array.
Array
a<elem>. The element signature is carried so an empty array still
marshals with the right type.
Struct(Vec<Value>)
(...)
Variant(Box<Value>)
v — a value that carries its own signature.
DictEntry(Box<Value>, Box<Value>)
{kv}, only ever valid as an array element.
Implementations§
Source§impl Value
impl Value
Sourcepub fn dict(entries: impl IntoIterator<Item = (String, Value)>) -> Self
pub fn dict(entries: impl IntoIterator<Item = (String, Value)>) -> Self
Build an a{sv} from pairs — the shape of nearly every BlueZ argument.
Sourcepub fn string_array(items: impl IntoIterator<Item = String>) -> Self
pub fn string_array(items: impl IntoIterator<Item = String>) -> Self
Build an as from strings.
pub fn as_str(&self) -> Option<&str>
pub fn as_bool(&self) -> Option<bool>
pub fn as_u64(&self) -> Option<u64>
pub fn as_i64(&self) -> Option<i64>
pub fn as_array(&self) -> Option<&[Value]>
Sourcepub fn as_strings(&self) -> Vec<String>
pub fn as_strings(&self) -> Vec<String>
Collect an as / ao into strings.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Forget for Value
impl Freeze for Value
impl Move for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more