pub struct Writer { /* private fields */ }Expand description
Wraps RingBuffer and allows to publish messages. Only single writer should be present at any time.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn claim(&self, len: usize, fin: bool) -> Claim<'_>
pub fn claim(&self, len: usize, fin: bool) -> Claim<'_>
Claim part of the underlying RingBuffer for publication. The fin flag is used to indicate
final message fragment.
§Panics
When aligned message length is greater than the MTU.
Sourcepub fn claim_with_user_defined(
&self,
len: usize,
fin: bool,
user_defined: u32,
) -> Claim<'_>
pub fn claim_with_user_defined( &self, len: usize, fin: bool, user_defined: u32, ) -> Claim<'_>
Claim part of the underlying RingBuffer for publication. The fin flag is used to indicate
final message fragment. This method also accepts user_defined value
that will be attached to the message frame header.
§Panics
When aligned message length is greater than the MTU.
Sourcepub fn continuation(&self, len: usize, fin: bool) -> Claim<'_>
pub fn continuation(&self, len: usize, fin: bool) -> Claim<'_>
Claim part of the underlying RingBuffer for continuation frame publication also passing
fin value to indicate final message fragment.
§Panics
When aligned message length is greater than the MTU.
Sourcepub fn heartbeat(&self) -> Claim<'_>
pub fn heartbeat(&self) -> Claim<'_>
Claim part of the underlying RingBuffer for heartbeat frame publication (zero payload,
no user defined field and no fragmentation). This operation will always succeed.
Sourcepub fn heartbeat_with_user_defined(&self, user_defined: u32) -> Claim<'_>
pub fn heartbeat_with_user_defined(&self, user_defined: u32) -> Claim<'_>
Claim part of the underlying RingBuffer for heartbeat frame publication with user defined
field (zero payload and no fragmentation). This operation will always succeed.