Struct mac_oui::Oui

source ·
pub struct Oui { /* private fields */ }

Implementations§

source§

impl Oui

source

pub fn default() -> Result<Oui, String>

Loads the default oui csv database The default database is loaded from: https://macaddress.io/database-download/csv

§Example
use mac_oui::Oui;

let db = Oui::default();
assert!(db.is_ok());
source

pub fn from_csv_file<P: AsRef<Path>>(oui_csv: P) -> Result<Oui, String>

Loads a database from the given path. The default database is loaded from: https://macaddress.io/database-download/csv

§Example
use mac_oui::Oui;

let db = Oui::from_csv_file("assets/oui.csv");
assert!(db.is_ok())
source

pub fn lookup_by_mac(&self, mac_addr: &str) -> Result<Option<&Entry>, String>

Lookup for a Manufacturer Name based upon the given MAC Address

source

pub fn lookup_by_manufacturer( &self, manufacturer_name: &str ) -> Result<Option<&Vec<Entry>>, String>

Lookup for the MAC Address Reference based upon the given Manufacturer Name

source

pub fn get_unique_manufacturers(&self) -> Result<Vec<String>, String>

Get a list of Manufacturers present in the database

source

pub fn get_unique_ouis(&self) -> Result<Vec<String>, String>

Get a list of MAC OUI references present in the database

source

pub fn get_total_records(&self) -> i32

Get total records in the database

Auto Trait Implementations§

§

impl Freeze for Oui

§

impl RefUnwindSafe for Oui

§

impl Send for Oui

§

impl Sync for Oui

§

impl Unpin for Oui

§

impl UnwindSafe for Oui

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.