Trait packet_formats::igmp::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.

Object Safety§

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§