Skip to main content

Sealed

Trait Sealed 

Source
pub trait Sealed {
    type Pos: Default + Clone;
    type Overhead: ArraySize;

    const NAME: &'static str;

    // Required methods
    fn get_pos<N: ArraySize>(
        buf: &MaybeUninit<Array<u8, N>>,
        pos: &Self::Pos,
    ) -> usize;
    fn set_pos<N: ArraySize>(
        buf: &mut MaybeUninit<Array<u8, N>>,
        pos: &mut Self::Pos,
        val: usize,
    );
    fn invariant(pos: usize, block_size: usize) -> bool;
    fn split_blocks<N: ArraySize>(data: &[u8]) -> (&[Array<u8, N>], &[u8]);
}
Expand description

Sealed trait for buffer kinds.

Required Associated Constants§

Source

const NAME: &'static str

Required Associated Types§

Required Methods§

Source

fn get_pos<N: ArraySize>( buf: &MaybeUninit<Array<u8, N>>, pos: &Self::Pos, ) -> usize

Source

fn set_pos<N: ArraySize>( buf: &mut MaybeUninit<Array<u8, N>>, pos: &mut Self::Pos, val: usize, )

Source

fn invariant(pos: usize, block_size: usize) -> bool

Invariant guaranteed by a buffer kind, i.e. with correct buffer code this function always returns true.

Source

fn split_blocks<N: ArraySize>(data: &[u8]) -> (&[Array<u8, N>], &[u8])

Split input data into slice of blocks and tail.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Sealed for Eager

Source§

const NAME: &'static str = "BlockBuffer<Eager>"

Source§

type Pos = ()

Source§

type Overhead = UTerm

Source§

impl Sealed for Lazy

Source§

const NAME: &'static str = "BlockBuffer<Lazy>"

Source§

type Pos = u8

Source§

type Overhead = UInt<UTerm, B1>