pub enum Value {
}Expand description
One D-Bus value. Containers carry enough type information to marshal even when empty: an array names its element signature.
Variants§
Byte(u8)
y
Bool(bool)
b
I16(i16)
n
U16(u16)
q
I32(i32)
i
U32(u32)
u
I64(i64)
x
U64(u64)
t
Double(f64)
d
Str(String)
s
ObjectPath(String)
o
Signature(String)
g
Array
a…: an array whose items all have the single complete type elem. A dictionary is an
array of Value::DictEntry items with an elem such as {sv}.
Fields
Struct(Vec<Value>)
(…): a struct of one or more fields.
DictEntry(Box<Value>, Box<Value>)
{kv}: a dictionary entry; only valid as an array item, with a basic-typed key.
Variant(Box<Value>)
v: a value that carries its own signature.
Implementations§
Source§impl Value
impl Value
Sourcepub fn array(elem: impl Into<String>, items: Vec<Value>) -> Value
pub fn array(elem: impl Into<String>, items: Vec<Value>) -> Value
An array with element signature elem.
Sourcepub fn dict(
key: &str,
value: &str,
entries: impl IntoIterator<Item = (Value, Value)>,
) -> Value
pub fn dict( key: &str, value: &str, entries: impl IntoIterator<Item = (Value, Value)>, ) -> Value
A dictionary a{kv} from key and value signatures and its entries.
Sourcepub fn props<K: Into<String>>(
entries: impl IntoIterator<Item = (K, Value)>,
) -> Value
pub fn props<K: Into<String>>( entries: impl IntoIterator<Item = (K, Value)>, ) -> Value
The a{sv} property dictionary most interfaces use.
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
The string inside a Str, ObjectPath or Signature (looking through variants).
Sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
Any integer value widened to i64 (looking through variants); None for a U64 above
i64::MAX or a non-integer.
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
The number inside a Double, or any integer converted (looking through variants).
Sourcepub fn unwrap_variant(&self) -> &Value
pub fn unwrap_variant(&self) -> &Value
The value inside a variant, or the value itself when it is not one.