pub struct Message { /* private fields */ }
Expand description
This represents a DBus message.
Implementations§
Source§impl Message
impl Message
pub fn encode(&self) -> EncodeResult<BytesMut>
pub fn encode_with_fds(&self) -> EncodeResult<(BytesMut, Vec<RawFd>)>
Source§impl Message
impl Message
Sourcepub fn method_call(
destination: Bus,
object_path: ObjectPath,
interface: Interface,
member: Member,
) -> Message
pub fn method_call( destination: Bus, object_path: ObjectPath, interface: Interface, member: Member, ) -> Message
Create a Message
object as a MethodCall
.
Sourcepub fn property_get(
destination: Bus,
object_path: ObjectPath,
interface: Interface,
property: &str,
) -> Message
pub fn property_get( destination: Bus, object_path: ObjectPath, interface: Interface, property: &str, ) -> Message
Create a Message
to retrieve property value.
Sourcepub fn properties_get_all(
destination: Bus,
object_path: ObjectPath,
interface: Interface,
) -> Message
pub fn properties_get_all( destination: Bus, object_path: ObjectPath, interface: Interface, ) -> Message
Create a Message
to retrieve property value.
Sourcepub fn property_set(
destination: Bus,
object_path: ObjectPath,
interface: Interface,
property: &str,
value: Value,
) -> Message
pub fn property_set( destination: Bus, object_path: ObjectPath, interface: Interface, property: &str, value: Value, ) -> Message
Create a Message
to retrieve property value.
Sourcepub const fn get_serial(&self) -> u32
pub const fn get_serial(&self) -> u32
Get the serial number.
Sourcepub fn set_serial(&mut self, serial: u32)
pub fn set_serial(&mut self, serial: u32)
Set the serial number.
Sourcepub const fn get_path(&self) -> Option<&ObjectPath>
pub const fn get_path(&self) -> Option<&ObjectPath>
Get the path
, if there is one in the header field.
Sourcepub const fn has_path(&self) -> bool
pub const fn has_path(&self) -> bool
It is true if the message contains a path
in the header fields.
Sourcepub const fn get_interface(&self) -> Option<&Interface>
pub const fn get_interface(&self) -> Option<&Interface>
Get the interface
, if there is one in the header field.
Sourcepub const fn has_interface(&self) -> bool
pub const fn has_interface(&self) -> bool
It is true if the message contains an interface
in the header fields.
Sourcepub const fn get_member(&self) -> Option<&Member>
pub const fn get_member(&self) -> Option<&Member>
Get the member
, if there is one in the header field.
Sourcepub const fn has_member(&self) -> bool
pub const fn has_member(&self) -> bool
It is true if the message contains a member
in the header fields.
Sourcepub const fn get_error_name(&self) -> Option<&Error>
pub const fn get_error_name(&self) -> Option<&Error>
Get the error_name
, if there is one in the header field.
Sourcepub const fn has_error_name(&self) -> bool
pub const fn has_error_name(&self) -> bool
It is true if the message contains an error_name
in the header fields.
Sourcepub const fn get_destination(&self) -> Option<&Bus>
pub const fn get_destination(&self) -> Option<&Bus>
Get the destination
, if there is one in the header field.
Sourcepub const fn has_destination(&self) -> bool
pub const fn has_destination(&self) -> bool
It is true if the message contains a destination
in the header fields.
Sourcepub const fn get_sender(&self) -> Option<&Bus>
pub const fn get_sender(&self) -> Option<&Bus>
Get the sender
, if there is one in the header field.
Sourcepub const fn has_sender(&self) -> bool
pub const fn has_sender(&self) -> bool
It is true if the message contains a sender
in the header fields.
Sourcepub const fn get_reply_serial(&self) -> Option<u32>
pub const fn get_reply_serial(&self) -> Option<u32>
Get the reply_serial
, if there is one in the header field.
Sourcepub const fn has_reply_serial(&self) -> bool
pub const fn has_reply_serial(&self) -> bool
It is true if the message contains a reply_serial
in the header fields.
Sourcepub fn get_signature(&self) -> Result<Vec<Type>, TypeError>
pub fn get_signature(&self) -> Result<Vec<Type>, TypeError>
Get the signature
, if there is one in the header field.
Sourcepub const fn has_signature(&self) -> bool
pub const fn has_signature(&self) -> bool
It is true if the message contains a signature
in the header fields.
Sourcepub const fn get_unix_fds(&self) -> Option<u32>
pub const fn get_unix_fds(&self) -> Option<u32>
Get the unix_fds
, if there is one in the header field.
Sourcepub const fn has_unix_fds(&self) -> bool
pub const fn has_unix_fds(&self) -> bool
It is true if the message contains a unix_fds
in the header fields.
Sourcepub fn method_return(&self) -> Result<Message, Message>
pub fn method_return(&self) -> Result<Message, Message>
Create a message return from this Message
.
Only works if this Message
is a MethodCall
.
Sourcepub fn unknown_property(&self, property: &str) -> Message
pub fn unknown_property(&self, property: &str) -> Message
Create a unknown property error message from this Message
.
Sourcepub fn unknown_path(&self) -> Option<Message>
pub fn unknown_path(&self) -> Option<Message>
Create a unknown path error message from this Message
.
Sourcepub fn unknown_interface(&self) -> Option<Message>
pub fn unknown_interface(&self) -> Option<Message>
Create a unknown interface error message from this Message
.
Sourcepub fn unknown_member(&self) -> Option<Message>
pub fn unknown_member(&self) -> Option<Message>
Create a unknown member error message from this Message
.
Sourcepub fn invalid_args(&self, reason: String) -> Message
pub fn invalid_args(&self, reason: String) -> Message
Create an invalid args error message from this Message
.
Sourcepub fn error(&self, name: Error, message: String) -> Message
pub fn error(&self, name: Error, message: String) -> Message
Create an error message from this Message
.
Sourcepub fn get_type(&self) -> MessageType
pub fn get_type(&self) -> MessageType
Get the message type.