Skip to main content

Library

Struct Library 

Source
pub struct Library { /* private fields */ }
Expand description

Instance of a opened wpcap library.

Implementations§

Source§

impl Library

Source

pub fn open_interface(&self, name: &str) -> Result<Interface<'_>, Error>

Source

pub fn dll(&self) -> &WPCapDll

Trait Implementations§

Source§

impl Library for Library

Source§

fn default_paths() -> &'static [&'static str]
where Self: Sized,

Returns list of default paths to the library on the given platform.
Source§

fn open(path: &str) -> Result<Self, Error>

Opens library by checking the provided path to it.
Source§

fn open_interface<'a>( &'a self, name: &str, ) -> Result<Box<dyn DynamicInterface<'a> + 'a>, Error>

Opens interface (network card or network device) with the provided name. Read more
Source§

fn version(&self) -> LibraryVersion

Returns library version
Source§

fn all_interfaces(&self) -> Result<Vec<InterfaceDescription>, Error>

Obtains list of available network interfaces. Read more
Source§

fn open_interface_arc<'a>( &'a self, name: &str, ) -> Result<Arc<dyn DynamicInterface<'a> + 'a>, Error>

Source§

fn open_default_paths() -> Result<Self, Error>
where Self: Sized,

Opens this library by searching for most common paths and names fro the given platform
Source§

fn open_paths<'b, T>(paths: T) -> Result<Self, Error>
where Self: Sized, T: IntoIterator<Item = &'b str>,

Opens library searching in the list of provided paths.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.