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 const fn claim(&mut self, len: usize, fin: bool) -> Claim<'_>
pub const fn claim(&mut 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 const fn claim_with_user_defined(
&mut self,
len: usize,
fin: bool,
user_defined: u32,
) -> Claim<'_>
pub const fn claim_with_user_defined( &mut 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 const fn continuation(&mut self, len: usize, fin: bool) -> Claim<'_>
pub const fn continuation(&mut 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.
Trait Implementations§
Source§impl From<RingBuffer> for Writer
impl From<RingBuffer> for Writer
Source§fn from(ring: RingBuffer) -> Self
fn from(ring: RingBuffer) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl !Send for Writer
impl !Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
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
Mutably borrows from an owned value. Read more