Struct dbus::Message [−][src]
pub struct Message { /* 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]
impl Message
pub fn new_method_call<'d, 'p, 'i, 'm, D, P, I, M>(
destination: D,
path: P,
iface: I,
method: M
) -> Result<Message, String> where
D: Into<BusName<'d>>,
P: Into<Path<'p>>,
I: Into<Interface<'i>>,
M: Into<Member<'m>>,
[src]
pub fn new_method_call<'d, 'p, 'i, 'm, D, P, I, M>(
destination: D,
path: P,
iface: I,
method: M
) -> Result<Message, String> where
D: Into<BusName<'d>>,
P: Into<Path<'p>>,
I: Into<Interface<'i>>,
M: Into<Member<'m>>,
Creates a new method call message.
pub fn method_call(
destination: &BusName,
path: &Path,
iface: &Interface,
name: &Member
) -> Message
[src]
pub fn method_call(
destination: &BusName,
path: &Path,
iface: &Interface,
name: &Member
) -> Message
Creates a new method call message.
pub 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>>,
[src]
pub 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.
pub fn signal(path: &Path, iface: &Interface, name: &Member) -> Message
[src]
pub fn signal(path: &Path, iface: &Interface, name: &Member) -> Message
Creates a new signal message.
pub fn new_method_return(m: &Message) -> Option<Message>
[src]
pub fn new_method_return(m: &Message) -> Option<Message>
Creates a method reply for this method call.
pub fn method_return(&self) -> Message
[src]
pub fn method_return(&self) -> Message
Creates a method return (reply) for this method call.
pub fn new_error(
m: &Message,
error_name: &str,
error_message: &str
) -> Option<Message>
[src]
pub fn new_error(
m: &Message,
error_name: &str,
error_message: &str
) -> Option<Message>
The old way to create a new error reply
pub fn error(&self, error_name: &ErrorName, error_message: &CStr) -> Message
[src]
pub fn error(&self, error_name: &ErrorName, error_message: &CStr) -> Message
Creates a new error reply
pub fn get_items(&self) -> Vec<MessageItem>
[src]
pub fn get_items(&self) -> Vec<MessageItem>
Get the MessageItems that make up the message.
Note: use iter_init
or get1
/get2
/etc instead for faster access to the arguments.
This method is provided for backwards compatibility.
pub fn get_serial(&self) -> u32
[src]
pub fn get_serial(&self) -> u32
Get the D-Bus serial of a message, if one was specified.
pub fn get_reply_serial(&self) -> Option<u32>
[src]
pub fn get_reply_serial(&self) -> Option<u32>
Get the serial of the message this message is a reply to, if present.
pub fn append_items(&mut self, v: &[MessageItem])
[src]
pub fn append_items(&mut self, v: &[MessageItem])
Add one or more MessageItems to this Message.
Note: using append1
, append2
or append3
might be faster, especially for large arrays.
This method is provided for backwards compatibility.
pub fn append<I: Into<MessageItem>>(self, v: I) -> Self
[src]
pub 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)
Note: using append1
, append2
or append3
might be faster, especially for large arrays.
This method is provided for backwards compatibility.
pub fn append1<A: Append>(self, a: A) -> Self
[src]
pub fn append1<A: Append>(self, a: A) -> Self
Appends one argument to this message.
Use in builder style: e g m.method_return().append1(7i32)
pub fn append2<A1: Append, A2: Append>(self, a1: A1, a2: A2) -> Self
[src]
pub fn append2<A1: Append, A2: Append>(self, a1: A1, a2: A2) -> Self
Appends two arguments to this message.
Use in builder style: e g m.method_return().append2(7i32, 6u8)
pub fn append3<A1: Append, A2: Append, A3: Append>(
self,
a1: A1,
a2: A2,
a3: A3
) -> Self
[src]
pub fn append3<A1: Append, A2: Append, A3: Append>(
self,
a1: A1,
a2: A2,
a3: A3
) -> Self
Appends three arguments to this message.
Use in builder style: e g m.method_return().append3(7i32, 6u8, true)
pub fn append_ref<A: RefArg>(self, r: &[A]) -> Self
[src]
pub fn append_ref<A: RefArg>(self, r: &[A]) -> Self
Appends RefArgs to this message.
Use in builder style: e g m.method_return().append_ref(&[7i32, 6u8, true])
pub fn get1<'a, G1: Get<'a>>(&'a self) -> Option<G1>
[src]
pub fn get1<'a, G1: Get<'a>>(&'a self) -> Option<G1>
Gets the first argument from the message, if that argument is of type G1. Returns None if there are not enough arguments, or if types don't match.
pub fn get2<'a, G1: Get<'a>, G2: Get<'a>>(&'a self) -> (Option<G1>, Option<G2>)
[src]
pub fn get2<'a, G1: Get<'a>, G2: Get<'a>>(&'a self) -> (Option<G1>, Option<G2>)
Gets the first two arguments from the message, if those arguments are of type G1 and G2. Returns None if there are not enough arguments, or if types don't match.
pub fn get3<'a, G1: Get<'a>, G2: Get<'a>, G3: Get<'a>>(
&'a self
) -> (Option<G1>, Option<G2>, Option<G3>)
[src]
pub fn get3<'a, G1: Get<'a>, G2: Get<'a>, G3: Get<'a>>(
&'a self
) -> (Option<G1>, Option<G2>, Option<G3>)
Gets the first three arguments from the message, if those arguments are of type G1, G2 and G3. Returns None if there are not enough arguments, or if types don't match.
pub fn get4<'a, G1: Get<'a>, G2: Get<'a>, G3: Get<'a>, G4: Get<'a>>(
&'a self
) -> (Option<G1>, Option<G2>, Option<G3>, Option<G4>)
[src]
pub fn get4<'a, G1: Get<'a>, G2: Get<'a>, G3: Get<'a>, G4: Get<'a>>(
&'a self
) -> (Option<G1>, Option<G2>, Option<G3>, Option<G4>)
Gets the first four arguments from the message, if those arguments are of type G1, G2, G3 and G4. Returns None if there are not enough arguments, or if types don't match.
pub fn get5<'a, G1: Get<'a>, G2: Get<'a>, G3: Get<'a>, G4: Get<'a>, G5: Get<'a>>(
&'a self
) -> (Option<G1>, Option<G2>, Option<G3>, Option<G4>, Option<G5>)
[src]
pub fn get5<'a, G1: Get<'a>, G2: Get<'a>, G3: Get<'a>, G4: Get<'a>, G5: Get<'a>>(
&'a self
) -> (Option<G1>, Option<G2>, Option<G3>, Option<G4>, Option<G5>)
Gets the first five arguments from the message, if those arguments are of type G1, G2, G3 and G4.
Returns None if there are not enough arguments, or if types don't match.
Note: If you need more than five arguments, use iter_init
instead.
pub fn read1<'a, G1: Arg + Get<'a>>(&'a self) -> Result<G1, TypeMismatchError>
[src]
pub fn read1<'a, G1: Arg + Get<'a>>(&'a self) -> Result<G1, TypeMismatchError>
Gets the first argument from the message, if that argument is of type G1.
Returns a TypeMismatchError if there are not enough arguments, or if types don't match.
pub fn read2<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2), TypeMismatchError>
[src]
pub fn read2<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2), TypeMismatchError>
Gets the first two arguments from the message, if those arguments are of type G1 and G2.
Returns a TypeMismatchError if there are not enough arguments, or if types don't match.
pub fn read3<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>, G3: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2, G3), TypeMismatchError>
[src]
pub fn read3<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>, G3: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2, G3), TypeMismatchError>
Gets the first three arguments from the message, if those arguments are of type G1, G2 and G3.
Returns a TypeMismatchError if there are not enough arguments, or if types don't match.
pub fn read4<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>, G3: Arg + Get<'a>, G4: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2, G3, G4), TypeMismatchError>
[src]
pub fn read4<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>, G3: Arg + Get<'a>, G4: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2, G3, G4), TypeMismatchError>
Gets the first four arguments from the message, if those arguments are of type G1, G2, G3 and G4.
Returns a TypeMismatchError if there are not enough arguments, or if types don't match.
pub fn read5<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>, G3: Arg + Get<'a>, G4: Arg + Get<'a>, G5: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2, G3, G4, G5), TypeMismatchError>
[src]
pub fn read5<'a, G1: Arg + Get<'a>, G2: Arg + Get<'a>, G3: Arg + Get<'a>, G4: Arg + Get<'a>, G5: Arg + Get<'a>>(
&'a self
) -> Result<(G1, G2, G3, G4, G5), TypeMismatchError>
Gets the first five arguments from the message, if those arguments are of type G1, G2, G3, G4 and G5.
Returns a TypeMismatchError if there are not enough arguments, or if types don't match.
Note: If you need more than five arguments, use iter_init
instead.
ⓘImportant traits for Iter<'a>pub fn iter_init<'a>(&'a self) -> Iter<'a>
[src]
pub fn iter_init<'a>(&'a self) -> Iter<'a>
Returns a struct for retreiving the arguments from a message. Supersedes get_items().
pub fn msg_type(&self) -> MessageType
[src]
pub fn msg_type(&self) -> MessageType
Gets the MessageType of the Message.
pub fn sender<'a>(&'a self) -> Option<BusName<'a>>
[src]
pub fn sender<'a>(&'a self) -> Option<BusName<'a>>
Gets the name of the connection that originated this message.
pub fn headers(
&self
) -> (MessageType, Option<String>, Option<String>, Option<String>)
[src]
pub fn headers(
&self
) -> (MessageType, Option<String>, Option<String>, Option<String>)
Returns a tuple of (Message type, Path, Interface, Member) of the current message.
pub fn path<'a>(&'a self) -> Option<Path<'a>>
[src]
pub fn path<'a>(&'a self) -> Option<Path<'a>>
Gets the object path this Message is being sent to.
pub fn interface<'a>(&'a self) -> Option<Interface<'a>>
[src]
pub fn interface<'a>(&'a self) -> Option<Interface<'a>>
Gets the interface this Message is being sent to.
pub fn member<'a>(&'a self) -> Option<Member<'a>>
[src]
pub fn member<'a>(&'a self) -> Option<Member<'a>>
Gets the interface member being called.
pub fn as_result(&mut self) -> Result<&mut Message, Error>
[src]
pub 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.
Trait Implementations
impl Send for Message
[src]
impl Send for Message
impl Drop for Message
[src]
impl Drop for Message
impl Debug for Message
[src]
impl Debug for Message
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl From<Message> for ConnectionItem
[src]
impl From<Message> for ConnectionItem