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

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

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

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

A D-Bus dictionary entry. These are only allowed inside an array.

A D-Bus objectpath requires its content to be a valid objectpath, so this cannot be any 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.)

A D-Bus boolean type.

A D-Bus unsigned 8 bit type.

A D-Bus signed 16 bit type.

A D-Bus signed 32 bit type.

A D-Bus signed 64 bit type.

A D-Bus unsigned 16 bit type.

A D-Bus unsigned 32 bit type.

A D-Bus unsigned 64 bit type.

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

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]

[src]

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.

[src]

Deprecated

: superseded by signature

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

[src]

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

[src]

Creates a (String, Variant) dictionary from an iterator with Result passthrough (an Err will abort and return that Err)

[src]

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.

[src]

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]

[src]

Formats the value using the given formatter.

impl PartialEq for MessageItem
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl PartialOrd for MessageItem
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<u8> for MessageItem
[src]

[src]

Performs the conversion.

impl From<u64> for MessageItem
[src]

[src]

Performs the conversion.

impl From<u32> for MessageItem
[src]

[src]

Performs the conversion.

impl From<u16> for MessageItem
[src]

[src]

Performs the conversion.

impl From<i16> for MessageItem
[src]

[src]

Performs the conversion.

impl From<i32> for MessageItem
[src]

[src]

Performs the conversion.

impl From<i64> for MessageItem
[src]

[src]

Performs the conversion.

impl From<f64> for MessageItem
[src]

[src]

Performs the conversion.

impl From<bool> for MessageItem
[src]

[src]

Performs the conversion.

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

Create a MessageItem::Array.

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl From<String> for MessageItem
[src]

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl From<OwnedFd> for MessageItem
[src]

[src]

Performs the conversion.

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

Create a MessageItem::Variant

[src]

Performs the conversion.

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

Create a MessageItem::DictEntry

[src]

Performs the conversion.

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

[src]

Allows converting from a MessageItem into the type it contains.

impl Append for MessageItem
[src]

[src]

Performs the append operation.

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

[src]

Performs the get operation.

impl RefArg for MessageItem
[src]

[src]

The corresponding D-Bus argument type code.

[src]

The corresponding D-Bus type signature for this type.

[src]

Performs the append operation.

[src]

Transforms this argument to Any (which can be downcasted to read the current value).

[src]

Transforms this argument to Any (which can be downcasted to read the current value). Read more

[src]

Try to read the argument as an i64.

[src]

Try to read the argument as a str.

[src]

Try to read the argument as an iterator.