Struct zbus::MessagePrimaryHeader
source · [−]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
sourceimpl 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
sourceimpl Clone for MessagePrimaryHeader
impl Clone for MessagePrimaryHeader
sourcefn clone(&self) -> MessagePrimaryHeader
fn clone(&self) -> MessagePrimaryHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MessagePrimaryHeader
impl Debug for MessagePrimaryHeader
sourceimpl<'de> Deserialize<'de> for MessagePrimaryHeader
impl<'de> Deserialize<'de> for MessagePrimaryHeader
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for MessagePrimaryHeader
impl Serialize for MessagePrimaryHeader
Auto Trait Implementations
impl RefUnwindSafe for MessagePrimaryHeader
impl Send for MessagePrimaryHeader
impl Sync for MessagePrimaryHeader
impl Unpin for MessagePrimaryHeader
impl UnwindSafe for MessagePrimaryHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'de, T> DynamicDeserialize<'de> for T where
T: Type + Deserialize<'de> + ?Sized,
impl<'de, T> DynamicDeserialize<'de> for T where
T: Type + Deserialize<'de> + ?Sized,
type Deserializer = PhantomData<T>
type Deserializer = PhantomData<T>
A DeserializeSeed implementation for this type.
sourcefn deserializer_for_signature<S>(
signature: S
) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error> where
S: TryInto<Signature<'de>>,
<S as TryInto<Signature<'de>>>::Error: Into<Error>,
fn deserializer_for_signature<S>(
signature: S
) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error> where
S: TryInto<Signature<'de>>,
<S as TryInto<Signature<'de>>>::Error: Into<Error>,
Get a deserializer compatible with this signature.
sourceimpl<T> DynamicType for T where
T: Type + ?Sized,
impl<T> DynamicType for T where
T: Type + ?Sized,
sourcefn dynamic_signature(&self) -> Signature<'_>
fn dynamic_signature(&self) -> Signature<'_>
Get the signature for the implementing type. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more