Struct pcap::Device

source ·
pub struct Device {
    pub name: String,
    pub desc: Option<String>,
    pub addresses: Vec<Address>,
    pub flags: DeviceFlags,
}
Expand description

A network device name and pcap’s description of it.

Fields

name: String

The name of the interface

desc: Option<String>

A textual description of the interface, if available

addresses: Vec<Address>

Addresses associated with this interface

flags: DeviceFlags

Interface flags

Implementations

Opens a Capture<Active> on this device.

Returns the default Device suitable for captures according to pcap_findalldevs, or an error from pcap. Note that there may be no suitable devices.

Returns a vector of Devices known by pcap via pcap_findalldevs.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.