Struct zbus::MessageHeader
source · [−]pub struct MessageHeader<'m> { /* private fields */ }
Expand description
The message header, containing all the metadata about the message.
This includes both the MessagePrimaryHeader
and MessageFields
.
Implementations
sourceimpl<'m> MessageHeader<'m>
impl<'m> MessageHeader<'m>
sourcepub fn new(primary: MessagePrimaryHeader, fields: MessageFields<'m>) -> Self
pub fn new(primary: MessagePrimaryHeader, fields: MessageFields<'m>) -> Self
Create a new MessageHeader
instance.
sourcepub fn primary(&self) -> &MessagePrimaryHeader
pub fn primary(&self) -> &MessagePrimaryHeader
Get a reference to the primary header.
sourcepub fn primary_mut(&mut self) -> &mut MessagePrimaryHeader
pub fn primary_mut(&mut self) -> &mut MessagePrimaryHeader
Get a mutable reference to the primary header.
sourcepub fn into_primary(self) -> MessagePrimaryHeader
pub fn into_primary(self) -> MessagePrimaryHeader
Get the primary header, consuming self
.
sourcepub fn fields<'s>(&'s self) -> &'s MessageFields<'m>
pub fn fields<'s>(&'s self) -> &'s MessageFields<'m>
Get a reference to the message fields.
sourcepub fn fields_mut<'s>(&'s mut self) -> &'s mut MessageFields<'m>
pub fn fields_mut<'s>(&'s mut self) -> &'s mut MessageFields<'m>
Get a mutable reference to the message fields.
sourcepub fn into_fields(self) -> MessageFields<'m>
pub fn into_fields(self) -> MessageFields<'m>
Get the message fields, consuming self
.
sourcepub fn message_type(&self) -> Result<MessageType, Error>
pub fn message_type(&self) -> Result<MessageType, Error>
The message type
sourcepub fn path<'s>(&'s self) -> Result<Option<&ObjectPath<'m>>, Error>
pub fn path<'s>(&'s self) -> Result<Option<&ObjectPath<'m>>, Error>
The object to send a call to, or the object a signal is emitted from.
sourcepub fn interface<'s>(&'s self) -> Result<Option<&InterfaceName<'m>>, Error>
pub fn interface<'s>(&'s self) -> Result<Option<&InterfaceName<'m>>, Error>
The interface to invoke a method call on, or that a signal is emitted from.
sourcepub fn member<'s>(&'s self) -> Result<Option<&MemberName<'m>>, Error>
pub fn member<'s>(&'s self) -> Result<Option<&MemberName<'m>>, Error>
The member, either the method name or signal name.
sourcepub fn error_name<'s>(&'s self) -> Result<Option<&ErrorName<'m>>, Error>
pub fn error_name<'s>(&'s self) -> Result<Option<&ErrorName<'m>>, Error>
The name of the error that occurred, for errors.
sourcepub fn reply_serial(&self) -> Result<Option<u32>, Error>
pub fn reply_serial(&self) -> Result<Option<u32>, Error>
The serial number of the message this message is a reply to.
sourcepub fn destination<'s>(&'s self) -> Result<Option<&BusName<'m>>, Error>
pub fn destination<'s>(&'s self) -> Result<Option<&BusName<'m>>, Error>
The name of the connection this message is intended for.
sourcepub fn sender<'s>(&'s self) -> Result<Option<&UniqueName<'m>>, Error>
pub fn sender<'s>(&'s self) -> Result<Option<&UniqueName<'m>>, Error>
Unique name of the sending connection.
Trait Implementations
sourceimpl<'m> Clone for MessageHeader<'m>
impl<'m> Clone for MessageHeader<'m>
sourcefn clone(&self) -> MessageHeader<'m>
fn clone(&self) -> MessageHeader<'m>
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<'m> Debug for MessageHeader<'m>
impl<'m> Debug for MessageHeader<'m>
sourceimpl<'de: 'm, 'm> Deserialize<'de> for MessageHeader<'m>
impl<'de: 'm, 'm> Deserialize<'de> for MessageHeader<'m>
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<'m> Serialize for MessageHeader<'m>
impl<'m> Serialize for MessageHeader<'m>
Auto Trait Implementations
impl<'m> RefUnwindSafe for MessageHeader<'m>
impl<'m> Send for MessageHeader<'m>
impl<'m> Sync for MessageHeader<'m>
impl<'m> Unpin for MessageHeader<'m>
impl<'m> UnwindSafe for MessageHeader<'m>
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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more