Skip to main content

MessageHeader

Struct MessageHeader 

Source
#[non_exhaustive]
pub struct MessageHeader { /* private fields */ }
Expand description

Fixed header present on all messages that traverse the runtime.

Implementations§

Source§

impl MessageHeader

Source

pub const fn new( trace_id: TraceId, sequence: SequenceNumber, creation_tick: Ticks, deadline_ns: Option<DeadlineNs>, qos: QoSClass, payload_size_bytes: usize, flags: MessageFlags, memory_class: MemoryClass, ) -> Self

Construct a new header.

Source

pub const fn empty() -> Self

A zero/identity header (safe for scratch use).

Source

pub fn is_empty(self) -> bool

Returns true is the message header is empty.

Source

pub fn sync_from_payload<P: Payload>(&mut self, payload: &P)

Update payload_size_bytes and memory_class from a payload descriptor.

Source

pub const fn trace_id(&self) -> &TraceId

Return the trace id.

Source

pub fn set_trace_id(&mut self, trace_id: TraceId)

Set the trace id.

Source

pub const fn sequence(&self) -> &SequenceNumber

Return the sequence number.

Source

pub fn set_sequence(&mut self, sequence: SequenceNumber)

Set the sequence number.

Source

pub const fn creation_tick(&self) -> &Ticks

Return the creation tick.

Source

pub fn set_creation_tick(&mut self, creation_tick: Ticks)

Set the creation tick.

Source

pub const fn deadline_ns(&self) -> &Option<DeadlineNs>

Return the optional deadline.

Source

pub fn set_deadline_ns(&mut self, deadline_ns: Option<DeadlineNs>)

Set the optional deadline in nanoseconds since boot.

Source

pub const fn qos(&self) -> &QoSClass

Return the QoS class.

Source

pub fn set_qos(&mut self, qos: QoSClass)

Set the QoS class.

Source

pub const fn payload_size_bytes(&self) -> &usize

Return the payload size in bytes.

Source

pub fn set_payload_size_bytes(&mut self, payload_size_bytes: usize)

Set the payload size in bytes.

Source

pub const fn flags(&self) -> &MessageFlags

Return the message flags.

Source

pub fn set_flags(&mut self, flags: MessageFlags)

Set the message flags.

Source

pub const fn memory_class(&self) -> &MemoryClass

Return the memory class.

Source

pub fn set_memory_class(&mut self, memory_class: MemoryClass)

Set the memory class.

Source

pub fn set_first_in_batch(&mut self)

Mark this header as the first element in a batch by setting FIRST_IN_BATCH.

Source

pub fn set_last_in_batch(&mut self)

Mark this header as the last element in a batch by setting LAST_IN_BATCH.

Trait Implementations§

Source§

impl Clone for MessageHeader

Source§

fn clone(&self) -> MessageHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MessageHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MessageHeader

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for MessageHeader

Source§

fn eq(&self, other: &MessageHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for MessageHeader

Source§

impl Eq for MessageHeader

Source§

impl StructuralPartialEq for MessageHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.