Struct mac_oui::Oui[][src]

pub struct Oui { /* fields omitted */ }

Implementations

impl Oui[src]

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

Loads the default oui csv database

Example

use mac_oui::Oui;

fn main() {
    let db = Oui::default();
    assert!(db.is_ok());
}

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

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

Example

use mac_oui::Oui;

fn main () {
    let db = Oui::from_csv_file("assets/oui.csv");
    assert!(db.is_ok())
}

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

Lookup for a Manufacturer Name based upon the given MAC Address

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

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

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

Get a list of Manufacturers present in the database

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

Get a list of MAC OUI references present in the database

pub fn get_total_records(&self) -> i32[src]

Get total records in the database

Auto Trait Implementations

impl RefUnwindSafe for Oui

impl Send for Oui

impl Sync for Oui

impl Unpin for Oui

impl UnwindSafe for Oui

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.