Skip to main content

WriteSlot

Trait WriteSlot 

Source
pub trait WriteSlot {
    // Required methods
    fn as_mut_slice(&mut self) -> &mut [u8] ;
    fn commit(self);
}
Expand description

A writable slot in the transport’s output buffer.

Obtained from LinkTxPermit::alloc. The caller writes encoded bytes into as_mut_slice, then calls commit to make them visible to the receiver.

Dropping without commit = discard (no bytes sent, space reclaimed).

Required Methods§

Source

fn as_mut_slice(&mut self) -> &mut [u8]

The writable buffer, exactly the size requested in alloc.

Source

fn commit(self)

Commit the written bytes. After this, the receiver can see them. Sync — the bytes are already in the transport’s buffer.

Implementors§