Tlv

Trait Tlv 

Source
pub trait Tlv: Sized {
    const TYPE: u8;

    // Required methods
    fn try_from_value(value: &[u8]) -> Option<Self>;
    fn value_bytes(&self) -> Cow<'_, [u8]>;

    // Provided method
    fn try_from_parts(typ: u8, value: &[u8]) -> Option<Self> { ... }
}

Required Associated Constants§

Source

const TYPE: u8

Required Methods§

Source

fn try_from_value(value: &[u8]) -> Option<Self>

Source

fn value_bytes(&self) -> Cow<'_, [u8]>

Provided Methods§

Source

fn try_from_parts(typ: u8, value: &[u8]) -> Option<Self>

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 Tlv for Alpn

Source§

const TYPE: u8 = 1u8

Source§

impl Tlv for Authority

Source§

const TYPE: u8 = 2u8

Source§

impl Tlv for Crc32c

Source§

const TYPE: u8 = 3u8

Source§

impl Tlv for Noop

Source§

const TYPE: u8 = 4u8

Source§

impl Tlv for Ssl

Source§

const TYPE: u8 = 32u8

Source§

impl Tlv for UniqueId

Source§

const TYPE: u8 = 5u8