Struct pnet_datalink::dummy::Config [] [src]

pub struct Config { /* fields omitted */ }

Configuration for the dummy datalink backend. Contains std::sync::mpsc channels that are used to communicate with the fake network.

Methods

impl Config
[src]

[src]

Creates a new Config with the given channels as the backing network. When using this constructor inject_handle and read_handle will return None. Those handles must be kept track of elsewhere.

The DataLinkReceiver created by the dummy backend will read packets from receiver. Both network errors and data can be sent on this channel. When the receiver channel is closed (Sender is dropped) DataLinkReceiver::next() will sleep forever, simlating an idle network.

The DataLinkSender created by the dummy backend will send all packets sent through build_and_send() and send_to() to the sender channel.

[src]

Get the Sender handle that can inject packets in the fake network. Only usable with Configs generated from default()

[src]

Get the Receiver handle where packets sent to the fake network can be read. Only usable with Configs generated from default()

Trait Implementations

impl Debug for Config
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a> From<&'a Config> for Config
[src]

[src]

Will not use the super::Config. This will simply call dummy::Config::default().

impl Default for Config
[src]

[src]

Creates a default config with one input and one output channel. The handles used to inject to and read form the network can be fetched with inject_handle() and read_handle()

Auto Trait Implementations

impl Send for Config

impl !Sync for Config