Enum dbus::MessageItem [−][src]
pub enum MessageItem { Array(MessageItemArray), Struct(Vec<MessageItem>), Variant(Box<MessageItem>), DictEntry(Box<MessageItem>, Box<MessageItem>), ObjectPath(Path<'static>), Str(String), Bool(bool), Byte(u8), Int16(i16), Int32(i32), Int64(i64), UInt16(u16), UInt32(u32), UInt64(u64), Double(f64), UnixFd(OwnedFd), }
MessageItem - used as parameters and return values from method calls, or as data added to a signal (old, enum version).
Note that the newer generic design (see arg
module) is both faster
and less error prone than MessageItem, and should be your first hand choice
whenever applicable.
Variants
Array(MessageItemArray)
A D-Bus array requires all elements to be of the same type. All elements must match the Signature.
Struct(Vec<MessageItem>)
A D-Bus struct allows for values of different types.
Variant(Box<MessageItem>)
A D-Bus variant is a wrapper around another MessageItem
, which
can be of any type.
DictEntry(Box<MessageItem>, Box<MessageItem>)
A D-Bus dictionary entry. These are only allowed inside an array.
ObjectPath(Path<'static>)
A D-Bus objectpath requires its content to be a valid objectpath, so this cannot be any string.
Str(String)
A D-Bus String is zero terminated, so no \0 s in the String, please. (D-Bus strings are also - like Rust strings - required to be valid UTF-8.)
Bool(bool)
A D-Bus boolean type.
Byte(u8)
A D-Bus unsigned 8 bit type.
Int16(i16)
A D-Bus signed 16 bit type.
Int32(i32)
A D-Bus signed 32 bit type.
Int64(i64)
A D-Bus signed 64 bit type.
UInt16(u16)
A D-Bus unsigned 16 bit type.
UInt32(u32)
A D-Bus unsigned 32 bit type.
UInt64(u64)
A D-Bus unsigned 64 bit type.
Double(f64)
A D-Bus IEEE-754 double-precision floating point type.
UnixFd(OwnedFd)
D-Bus allows for sending file descriptors, which can be used to set up SHM, unix pipes, or other communication channels.
Methods
impl MessageItem
[src]
impl MessageItem
pub fn signature(&self) -> Signature<'static>
[src]
pub fn signature(&self) -> Signature<'static>
Get the D-Bus Signature for this MessageItem.
Note: Since dictionary entries have no valid signature, calling this function for a dict entry will cause a panic.
pub fn type_sig(&self) -> TypeSig<'static>
[src]
pub fn type_sig(&self) -> TypeSig<'static>
: superseded by signature
Get the D-Bus ASCII type-code for this MessageItem.
pub fn array_type(&self) -> i32
[src]
pub fn array_type(&self) -> i32
Get the integer value for this MessageItem's type-code.
pub fn from_dict<E, I: Iterator<Item = Result<(String, MessageItem), E>>>(
i: I
) -> Result<MessageItem, E>
[src]
pub fn from_dict<E, I: Iterator<Item = Result<(String, MessageItem), E>>>(
i: I
) -> Result<MessageItem, E>
Creates a (String, Variant) dictionary from an iterator with Result passthrough (an Err will abort and return that Err)
pub fn new_array(v: Vec<MessageItem>) -> Result<MessageItem, ArrayError>
[src]
pub fn new_array(v: Vec<MessageItem>) -> Result<MessageItem, ArrayError>
Creates an MessageItem::Array from a list of MessageItems.
Note: This requires v
to be non-empty. See also
MessageItem::from(&[T])
, which can handle empty arrays as well.
pub fn inner<'a, T: FromMessageItem<'a>>(&'a self) -> Result<T, ()>
[src]
pub fn inner<'a, T: FromMessageItem<'a>>(&'a self) -> Result<T, ()>
Conveniently get the inner value of a MessageItem
Example
use dbus::MessageItem; let m: MessageItem = 5i64.into(); let s: i64 = m.inner().unwrap(); assert_eq!(s, 5i64);
Trait Implementations
impl Debug for MessageItem
[src]
impl Debug for MessageItem
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for MessageItem
[src]
impl PartialEq for MessageItem
fn eq(&self, other: &MessageItem) -> bool
[src]
fn eq(&self, other: &MessageItem) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MessageItem) -> bool
[src]
fn ne(&self, other: &MessageItem) -> bool
This method tests for !=
.
impl PartialOrd for MessageItem
[src]
impl PartialOrd for MessageItem
fn partial_cmp(&self, other: &MessageItem) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &MessageItem) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &MessageItem) -> bool
[src]
fn lt(&self, other: &MessageItem) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &MessageItem) -> bool
[src]
fn le(&self, other: &MessageItem) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &MessageItem) -> bool
[src]
fn gt(&self, other: &MessageItem) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &MessageItem) -> bool
[src]
fn ge(&self, other: &MessageItem) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Clone for MessageItem
[src]
impl Clone for MessageItem
fn clone(&self) -> MessageItem
[src]
fn clone(&self) -> MessageItem
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl From<u8> for MessageItem
[src]
impl From<u8> for MessageItem
fn from(i: u8) -> MessageItem
[src]
fn from(i: u8) -> MessageItem
Performs the conversion.
impl From<u64> for MessageItem
[src]
impl From<u64> for MessageItem
fn from(i: u64) -> MessageItem
[src]
fn from(i: u64) -> MessageItem
Performs the conversion.
impl From<u32> for MessageItem
[src]
impl From<u32> for MessageItem
fn from(i: u32) -> MessageItem
[src]
fn from(i: u32) -> MessageItem
Performs the conversion.
impl From<u16> for MessageItem
[src]
impl From<u16> for MessageItem
fn from(i: u16) -> MessageItem
[src]
fn from(i: u16) -> MessageItem
Performs the conversion.
impl From<i16> for MessageItem
[src]
impl From<i16> for MessageItem
fn from(i: i16) -> MessageItem
[src]
fn from(i: i16) -> MessageItem
Performs the conversion.
impl From<i32> for MessageItem
[src]
impl From<i32> for MessageItem
fn from(i: i32) -> MessageItem
[src]
fn from(i: i32) -> MessageItem
Performs the conversion.
impl From<i64> for MessageItem
[src]
impl From<i64> for MessageItem
fn from(i: i64) -> MessageItem
[src]
fn from(i: i64) -> MessageItem
Performs the conversion.
impl From<f64> for MessageItem
[src]
impl From<f64> for MessageItem
fn from(i: f64) -> MessageItem
[src]
fn from(i: f64) -> MessageItem
Performs the conversion.
impl From<bool> for MessageItem
[src]
impl From<bool> for MessageItem
fn from(i: bool) -> MessageItem
[src]
fn from(i: bool) -> MessageItem
Performs the conversion.
impl<'a, T> From<&'a [T]> for MessageItem where
T: Into<MessageItem> + Clone + Default,
[src]
impl<'a, T> From<&'a [T]> for MessageItem where
T: Into<MessageItem> + Clone + Default,
Create a MessageItem::Array
.
fn from(i: &'a [T]) -> MessageItem
[src]
fn from(i: &'a [T]) -> MessageItem
Performs the conversion.
impl<'a> From<&'a str> for MessageItem
[src]
impl<'a> From<&'a str> for MessageItem
fn from(i: &str) -> MessageItem
[src]
fn from(i: &str) -> MessageItem
Performs the conversion.
impl From<String> for MessageItem
[src]
impl From<String> for MessageItem
fn from(i: String) -> MessageItem
[src]
fn from(i: String) -> MessageItem
Performs the conversion.
impl From<Path<'static>> for MessageItem
[src]
impl From<Path<'static>> for MessageItem
fn from(i: Path<'static>) -> MessageItem
[src]
fn from(i: Path<'static>) -> MessageItem
Performs the conversion.
impl From<OwnedFd> for MessageItem
[src]
impl From<OwnedFd> for MessageItem
fn from(i: OwnedFd) -> MessageItem
[src]
fn from(i: OwnedFd) -> MessageItem
Performs the conversion.
impl From<Box<MessageItem>> for MessageItem
[src]
impl From<Box<MessageItem>> for MessageItem
Create a MessageItem::Variant
fn from(i: Box<MessageItem>) -> MessageItem
[src]
fn from(i: Box<MessageItem>) -> MessageItem
Performs the conversion.
impl From<(MessageItem, MessageItem)> for MessageItem
[src]
impl From<(MessageItem, MessageItem)> for MessageItem
Create a MessageItem::DictEntry
fn from(i: (MessageItem, MessageItem)) -> MessageItem
[src]
fn from(i: (MessageItem, MessageItem)) -> MessageItem
Performs the conversion.
impl<'a> FromMessageItem<'a> for &'a MessageItem
[src]
impl<'a> FromMessageItem<'a> for &'a MessageItem
fn from(i: &'a MessageItem) -> Result<&'a MessageItem, ()>
[src]
fn from(i: &'a MessageItem) -> Result<&'a MessageItem, ()>
Allows converting from a MessageItem into the type it contains.
impl Append for MessageItem
[src]
impl Append for MessageItem
fn append(self, i: &mut IterAppend)
[src]
fn append(self, i: &mut IterAppend)
Performs the append operation.
impl<'a> Get<'a> for MessageItem
[src]
impl<'a> Get<'a> for MessageItem
impl RefArg for MessageItem
[src]
impl RefArg for MessageItem
fn arg_type(&self) -> ArgType
[src]
fn arg_type(&self) -> ArgType
The corresponding D-Bus argument type code.
fn signature(&self) -> Signature<'static>
[src]
fn signature(&self) -> Signature<'static>
The corresponding D-Bus type signature for this type.
fn append(&self, i: &mut IterAppend)
[src]
fn append(&self, i: &mut IterAppend)
Performs the append operation.
fn as_any(&self) -> &Any where
Self: 'static,
[src]
fn as_any(&self) -> &Any where
Self: 'static,
Transforms this argument to Any (which can be downcasted to read the current value).
fn as_any_mut(&mut self) -> &mut Any where
Self: 'static,
[src]
fn as_any_mut(&mut self) -> &mut Any where
Self: 'static,
Transforms this argument to Any (which can be downcasted to read the current value). Read more
fn as_i64(&self) -> Option<i64>
[src]
fn as_i64(&self) -> Option<i64>
Try to read the argument as an i64. Read more
fn as_u64(&self) -> Option<u64>
[src]
fn as_u64(&self) -> Option<u64>
Try to read the argument as an u64. Read more
fn as_f64(&self) -> Option<f64>
[src]
fn as_f64(&self) -> Option<f64>
Try to read the argument as an f64. Read more
fn as_str(&self) -> Option<&str>
[src]
fn as_str(&self) -> Option<&str>
Try to read the argument as a str. Read more
fn as_iter<'a>(&'a self) -> Option<Box<Iterator<Item = &'a RefArg> + 'a>>
[src]
fn as_iter<'a>(&'a self) -> Option<Box<Iterator<Item = &'a RefArg> + 'a>>
Try to read the argument as an iterator. Read more
Auto Trait Implementations
impl Send for MessageItem
impl Send for MessageItem
impl Sync for MessageItem
impl Sync for MessageItem