Struct dbus::Message

source ·
pub struct Message { /* private fields */ }
Expand description

A D-Bus message. A message contains some headers (e g sender and destination address) and a list of MessageItems.

Implementations

Creates a new method call message.

Creates a new method call message.

Creates a new signal message.

Creates a new signal message.

Creates a method reply for this method call.

Creates a method return (reply) for this method call.

The old way to create a new error reply

Creates a new error reply

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.

Get the D-Bus serial of a message, if one was specified.

Get the serial of the message this message is a reply to, if present.

Returns true if the message does not expect a reply.

Set whether or not the message expects a reply.

Set to true if you send a method call and do not want a reply.

Returns true if the message can cause a service to be auto-started.

Sets whether or not the message can cause a service to be auto-started.

Defaults to true.

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.

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.

Appends one argument to this message. Use in builder style: e g m.method_return().append1(7i32)

Appends two arguments to this message. Use in builder style: e g m.method_return().append2(7i32, 6u8)

Appends three arguments to this message. Use in builder style: e g m.method_return().append3(7i32, 6u8, true)

Appends RefArgs to this message. Use in builder style: e g m.method_return().append_ref(&[7i32, 6u8, true])

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Returns a struct for retreiving the arguments from a message. Supersedes get_items().

Gets the MessageType of the Message.

Gets the name of the connection that originated this message.

Returns a tuple of (Message type, Path, Interface, Member) of the current message.

Gets the object path this Message is being sent to.

Gets the destination this Message is being sent to.

Sets the destination of this Message

If dest is none, that means broadcast to all relevant destinations.

Gets the interface this Message is being sent to.

Gets the interface member being called.

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

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.