packet_formats::icmp::mld

Trait MaxCode

Source
pub trait MaxCode<T: Default + Debug + FromBytes + IntoBytes> {
    // Required methods
    fn as_code(self) -> T;
    fn from_code(code: T) -> Self;
}
Expand description

The trait for MLD codes that can be further interpreted using different methods e.g. QQIC.

The type implementing this trait should be able to convert itself from/to T

Required Methods§

Source

fn as_code(self) -> T

Convert to T

Source

fn from_code(code: T) -> Self

Convert from T

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.

Implementations on Foreign Types§

Source§

impl<T: Default + Debug + FromBytes + IntoBytes> MaxCode<T> for ()

Source§

fn as_code(self) -> T

Source§

fn from_code(_: T) -> Self

Implementors§

Source§

impl MaxCode<u8> for Mldv2QQIC

Source§

impl MaxCode<U16<BigEndian>> for Mldv1ResponseDelay

Source§

impl MaxCode<U16<BigEndian>> for Mldv2ResponseDelay