Enum dbus::MessageItem [] [src]

pub enum MessageItem {
    Array(Vec<MessageItem>, TypeSig<'static>),
    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.

Variants

Array

A D-Bus array requires all elements to be of the same type. All elements must match the TypeSig.

Struct

A D-Bus struct allows for values of different types.

Variant

A D-Bus variant is a wrapper around another MessageItem, which can be of any type.

DictEntry

A D-Bus dictionary is an Array of DictEntry items.

ObjectPath

A D-Bus objectpath requires its content to be a valid objectpath, so this cannot be any string.

Str

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

A D-Bus boolean type.

Byte

A D-Bus unsigned 8 bit type.

Int16

A D-Bus signed 16 bit type.

Int32

A D-Bus signed 32 bit type.

Int64

A D-Bus signed 64 bit type.

UInt16

A D-Bus unsigned 16 bit type.

UInt32

A D-Bus unsigned 32 bit type.

UInt64

A D-Bus unsigned 64 bit type.

Double

A D-Bus IEEE-754 double-precision floating point type.

UnixFd

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]

fn type_sig(&self) -> TypeSig<'static>

Get the D-Bus ASCII type-code for this MessageItem.

fn array_type(&self) -> i32

Get the integer value for this MessageItem's type-code.

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)

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.

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 From<u8> for MessageItem
[src]

fn from(i: u8) -> MessageItem

impl From<u64> for MessageItem
[src]

fn from(i: u64) -> MessageItem

impl From<u32> for MessageItem
[src]

fn from(i: u32) -> MessageItem

impl From<u16> for MessageItem
[src]

fn from(i: u16) -> MessageItem

impl From<i16> for MessageItem
[src]

fn from(i: i16) -> MessageItem

impl From<i32> for MessageItem
[src]

fn from(i: i32) -> MessageItem

impl From<i64> for MessageItem
[src]

fn from(i: i64) -> MessageItem

impl From<f64> for MessageItem
[src]

fn from(i: f64) -> MessageItem

impl From<bool> for MessageItem
[src]

fn from(i: bool) -> MessageItem

impl<'a, T> From<&'a [T]> for MessageItem where T: Into<MessageItem> + Clone + Default
[src]

Create a MessageItem::Array.

fn from(i: &'a [T]) -> MessageItem

impl<'a> From<&'a str> for MessageItem
[src]

fn from(i: &str) -> MessageItem

impl From<String> for MessageItem
[src]

fn from(i: String) -> MessageItem

impl From<Path<'static>> for MessageItem
[src]

fn from(i: Path<'static>) -> MessageItem

impl From<OwnedFd> for MessageItem
[src]

fn from(i: OwnedFd) -> MessageItem

impl From<Box<MessageItem>> for MessageItem
[src]

Create a MessageItem::Variant

fn from(i: Box<MessageItem>) -> MessageItem

impl From<(MessageItem, MessageItem)> for MessageItem
[src]

Create a MessageItem::DictEntry

fn from(i: (MessageItem, MessageItem)) -> MessageItem

impl<'a> FromMessageItem<'a> for &'a MessageItem
[src]

fn from(i: &'a MessageItem) -> Result<&'a MessageItem, ()>

impl PropertyROHandler for MessageItem
[src]

fn get(&self) -> PropertyGetResult

impl Append for MessageItem
[src]

fn append(self, i: &mut IterAppend)

impl<'a> Get<'a> for MessageItem
[src]

fn get(i: &mut Iter<'a>) -> Option<Self>

Derived Implementations

impl Clone for MessageItem
[src]

fn clone(&self) -> MessageItem

fn clone_from(&mut self, source: &Self)
1.0.0

impl PartialOrd for MessageItem
[src]

fn partial_cmp(&self, __arg_0: &MessageItem) -> Option<Ordering>

fn lt(&self, __arg_0: &MessageItem) -> bool

fn le(&self, __arg_0: &MessageItem) -> bool

fn gt(&self, __arg_0: &MessageItem) -> bool

fn ge(&self, __arg_0: &MessageItem) -> bool

impl PartialEq for MessageItem
[src]

fn eq(&self, __arg_0: &MessageItem) -> bool

fn ne(&self, __arg_0: &MessageItem) -> bool

impl Debug for MessageItem
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result