pub struct MessagePrimaryHeader { /* private fields */ }
Expand description
The primary message header, which is present in all D-Bus messages.
This header contains all the essential information about a message, regardless of its type.
Implementations§
source§impl MessagePrimaryHeader
impl MessagePrimaryHeader
sourcepub fn new(msg_type: MessageType, body_len: u32) -> Self
pub fn new(msg_type: MessageType, body_len: u32) -> Self
Create a new MessagePrimaryHeader
instance.
sourcepub fn endian_sig(&self) -> EndianSig
pub fn endian_sig(&self) -> EndianSig
D-Bus code for bytorder encoding of the message.
sourcepub fn set_endian_sig(&mut self, sig: EndianSig)
pub fn set_endian_sig(&mut self, sig: EndianSig)
Set the D-Bus code for bytorder encoding of the message.
sourcepub fn msg_type(&self) -> MessageType
pub fn msg_type(&self) -> MessageType
The message type.
sourcepub fn set_msg_type(&mut self, msg_type: MessageType)
pub fn set_msg_type(&mut self, msg_type: MessageType)
Set the message type.
sourcepub fn flags(&self) -> BitFlags<MessageFlags>
pub fn flags(&self) -> BitFlags<MessageFlags>
The message flags.
sourcepub fn set_flags(&mut self, flags: BitFlags<MessageFlags>)
pub fn set_flags(&mut self, flags: BitFlags<MessageFlags>)
Set the message flags.
sourcepub fn protocol_version(&self) -> u8
pub fn protocol_version(&self) -> u8
The major version of the protocol the message is compliant to.
Currently only 1
is valid.
sourcepub fn set_protocol_version(&mut self, version: u8)
pub fn set_protocol_version(&mut self, version: u8)
Set the major version of the protocol the message is compliant to.
Currently only 1
is valid.
sourcepub fn set_body_len(&mut self, len: u32)
pub fn set_body_len(&mut self, len: u32)
Set the byte length of the message body.
sourcepub fn serial_num(&self) -> Option<&u32>
pub fn serial_num(&self) -> Option<&u32>
The serial number of the message (if set).
This is used to match a reply to a method call.
Note: There is no setter provided for this in the public API since this is set by the
Connection
the message is sent over.
Trait Implementations§
source§impl Clone for MessagePrimaryHeader
impl Clone for MessagePrimaryHeader
source§fn clone(&self) -> MessagePrimaryHeader
fn clone(&self) -> MessagePrimaryHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MessagePrimaryHeader
impl Debug for MessagePrimaryHeader
source§impl<'de> Deserialize<'de> for MessagePrimaryHeader
impl<'de> Deserialize<'de> for MessagePrimaryHeader
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Serialize for MessagePrimaryHeader
impl Serialize for MessagePrimaryHeader
Auto Trait Implementations§
impl !Freeze for MessagePrimaryHeader
impl RefUnwindSafe for MessagePrimaryHeader
impl Send for MessagePrimaryHeader
impl Sync for MessagePrimaryHeader
impl Unpin for MessagePrimaryHeader
impl UnwindSafe for MessagePrimaryHeader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)