Struct phonenumber::metadata::Database
source · pub struct Database { /* private fields */ }
Expand description
Representation of a database of metadata for phone number.
Implementations§
source§impl Database
impl Database
sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, LoadMetadata>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, LoadMetadata>
Load a database from the given file.
sourcepub fn parse<S: AsRef<str>>(content: S) -> Result<Self, LoadMetadata>
pub fn parse<S: AsRef<str>>(content: S) -> Result<Self, LoadMetadata>
Parse a database from the given string.
sourcepub fn from(meta: Vec<Metadata>) -> Result<Self, LoadMetadata>
pub fn from(meta: Vec<Metadata>) -> Result<Self, LoadMetadata>
Create a database from a loaded database.
sourcepub fn cache(&self) -> Arc<Mutex<RegexCache>>
pub fn cache(&self) -> Arc<Mutex<RegexCache>>
Get the regular expression cache.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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