Enum pnet_datalink::Channel [] [src]

pub enum Channel {
    Ethernet(Box<DataLinkSender>, Box<DataLinkReceiver>),
    PleaseIncludeACatchAllVariantWhenMatchingOnThisEnum,
}

A channel for sending and receiving at the data link layer

NOTE: It is important to always include a catch-all variant in match statements using this enum, since new variants may be added. For example:

This example is not tested
match some_channel {
    Ethernet(tx, rx) => { /* Handle Ethernet packets */ },
    _ => panic!("Unhandled channel type")
}

Variants

A datalink channel which sends and receives Ethernet packets

This variant should never be used

Including it allows new variants to be added to Channel without breaking existing code.

Trait Implementations

Auto Trait Implementations

impl Send for Channel

impl !Sync for Channel