Struct dbus::Message
[−]
[src]
pub struct Message { // some fields omitted }
A D-Bus message. A message contains some headers (e g sender and destination address) and a list of MessageItems.
Methods
impl Message
[src]
fn new_method_call<D, P, I, M>(destination: D, path: P, iface: I, method: M) -> Result<Message, String> where D: Into<BusName>, P: Into<Path>, I: Into<Interface>, M: Into<Member>
Creates a new method call message.
fn method_call(destination: &BusName, path: &Path, iface: &Interface, name: &Member) -> Message
Creates a new method call message.
fn new_signal<P, I, M>(path: P, iface: I, name: M) -> Result<Message, String> where P: Into<Vec<u8>>, I: Into<Vec<u8>>, M: Into<Vec<u8>>
Creates a new signal message.
fn signal(path: &Path, iface: &Interface, name: &Member) -> Message
Creates a new signal message.
fn new_method_return(m: &Message) -> Option<Message>
Creates a method reply for this method call.
fn method_return(&self) -> Message
Creates a method return (reply) for this method call.
fn new_error(m: &Message, error_name: &str, error_message: &str) -> Option<Message>
fn error(&self, error_name: &ErrorName, error_message: &CStr) -> Message
Creates a new error reply
fn get_items(&self) -> Vec<MessageItem>
fn get_serial(&self) -> u32
fn get_reply_serial(&self) -> Option<u32>
fn append_items(&mut self, v: &[MessageItem])
fn append<I: Into<MessageItem>>(self, v: I) -> Self
Appends one MessageItem to a message.
Use in builder style: e g m.method_return().append(7i32)
fn msg_type(&self) -> MessageType
fn sender(&self) -> Option<String>
fn headers(&self) -> (MessageType, Option<String>, Option<String>, Option<String>)
Returns a tuple of (Message type, Path, Interface, Member) of the current message.
fn path(&self) -> Option<Path>
fn interface(&self) -> Option<Interface>
fn member(&self) -> Option<Member>
fn as_result(&mut self) -> Result<&mut Message, Error>
When the remote end returns an error, the message itself is correct but its contents is an error. This method will transform such an error to a D-Bus Error or otherwise return the original message.