pub struct MessageHeader { /* private fields */ }
Expand description
This represents a DBus message header.
Implementations§
Source§impl Header
impl Header
Sourcepub fn new(
is_le: bool,
message_type: MessageType,
message_flags: MessageFlags,
version: u8,
serial: u32,
fields: HeaderFields,
) -> Result<Header, HeaderError>
pub fn new( is_le: bool, message_type: MessageType, message_flags: MessageFlags, version: u8, serial: u32, fields: HeaderFields, ) -> Result<Header, HeaderError>
Create a [MessageHeader
] object. It can fail if the required header fields are not
present.
Sourcepub const fn get_serial(&self) -> u32
pub const fn get_serial(&self) -> u32
Get 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) -> Option<&[Type]>
pub fn get_signature(&self) -> Option<&[Type]>
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, error: Error, message: String) -> Message
pub fn error(&self, error: 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.