Struct dbus_bytestream::message::Message [-] [+] [src]

pub struct Message {
    pub big_endian: bool,
    pub message_type: MessageType,
    pub flags: u8,
    pub version: u8,
    pub serial: u32,
    pub headers: Vec<HeaderField>,
    pub body: Vec<u8>,
}

Represents a received message from the message bus

Fields

big_endian
message_type
flags
version
serial
headers
body

Methods

impl Message

fn add_arg(self, arg: &Marshal) -> Message

Add the given argument to the Message. Accepts anything that implements the Marshal trait, which is most basic types, as well as the general-purpose dbus_serialize::types::Value enum.

Note that these calls can be chained together to add multiple arguments, see the example

Examples

dbus_bytestream::message::create_method_call("foo", "/bar", "baz", "bloop")
    .add_arg(&1)
    .add_arg(&"string");

fn get_header(&mut self, name: u8) -> Option<&mut Variant>

fn add_header(self, name: u8, val: Variant) -> Message

fn get_body(&mut self) -> Result<Option<Vec<Value>>, DemarshalError>

Get the sequence of Values from out of a Message. Returns None if the message doesn't have a body.

Trait Implementations

impl Marshal for Message

fn dbus_encode(&self, buf: &mut Vec<u8>) -> usize

fn get_type(&self) -> String

Derived Implementations

impl Default for Message

fn default() -> Message

impl Debug for Message

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