packet_formats::igmp

Trait IgmpMaxRespCode

Source
pub trait IgmpMaxRespCode {
    // Required methods
    fn as_code(&self) -> u8;
    fn from_code(code: u8) -> Self;
}
Expand description

Trait for treating the max_resp_code field of HeaderPrefix.

There are parsing differences between IGMP v2 and v3 for the maximum response code (in IGMP v2 is in fact called maximum response time). That’s the reasoning behind making this a trait, so it can be specialized differently with thin wrappers by the messages implementation.

Required Methods§

Source

fn as_code(&self) -> u8

The serialized value of the response code

Source

fn from_code(code: u8) -> Self

Parses from a code value.

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 IgmpMaxRespCode for ()

Max Resp Code should be ignored on all non-query incoming messages and set to zero on all non-query outgoing messages, the implementation for () provides that.

Source§

fn as_code(&self) -> u8

Source§

fn from_code(_code: u8)

Implementors§