pub struct Oui { /* private fields */ }
Implementations§
source§impl Oui
impl Oui
sourcepub fn default() -> Result<Oui, String>
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());
sourcepub fn from_csv_file<P: AsRef<Path>>(oui_csv: P) -> Result<Oui, String>
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())
sourcepub fn lookup_by_mac(&self, mac_addr: &str) -> Result<Option<&Entry>, String>
pub fn lookup_by_mac(&self, mac_addr: &str) -> Result<Option<&Entry>, String>
Lookup for a Manufacturer Name based upon the given MAC Address
sourcepub fn lookup_by_manufacturer(
&self,
manufacturer_name: &str
) -> Result<Option<&Vec<Entry>>, String>
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
sourcepub fn get_unique_manufacturers(&self) -> Result<Vec<String>, String>
pub fn get_unique_manufacturers(&self) -> Result<Vec<String>, String>
Get a list of Manufacturers present in the database
sourcepub fn get_unique_ouis(&self) -> Result<Vec<String>, String>
pub fn get_unique_ouis(&self) -> Result<Vec<String>, String>
Get a list of MAC OUI references present in the database
sourcepub fn get_total_records(&self) -> i32
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more