Skip to main content

Tag

Trait Tag 

Source
pub(crate) trait Tag {
    type Buf: AsRef<[u8]> + AsMut<[u8]> + Debug + Unpin;

    const PATTERN: &'static [u8];

    // Required method
    fn make_buf() -> Self::Buf;
}
Expand description

Tag defines a “trailer tag”: specific, fixed bytes that must follow wire data.

Required Associated Constants§

Source

const PATTERN: &'static [u8]

The expected suffix

The first 8 bytes may be ignored, and it must be an 8-byte aligned size.

Required Associated Types§

Source

type Buf: AsRef<[u8]> + AsMut<[u8]> + Debug + Unpin

Suitably sized buffer for reading Self::PATTERN

HACK: This is a workaround for const generics limitations.

Required Methods§

Source

fn make_buf() -> Self::Buf

Make an instance of Self::Buf

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Tag for Pad

Source§

const PATTERN: &'static [u8]

Source§

type Buf = [u8; 8]

Source§

impl Tag for PadPar

Available on crate features async and wire only.
Source§

const PATTERN: &'static [u8]

Source§

type Buf = [u8; 24]