[][src]Struct zone_detect::Database

pub struct Database {
    pub field_names: Vec<String>,
    pub notice: String,
    pub precision: u8,
    pub table_type: TableType,
    pub version: u8,
    // some fields omitted
}

Zone database.

Fields

field_names: Vec<String>

Names of all the fields in the database.

notice: String

Database notice text (e.g. for licensing information).

precision: u8

Precision of the data.

table_type: TableType

Type of data (country or timezone).

version: u8

Encoding version.

Methods

impl Database[src]

pub fn open<P: AsRef<Path>>(path: P) -> Result<Database>[src]

Open a zone database.

pub fn from_vec(mapping: Vec<u8>) -> Result<Database>[src]

Load the database from a byte vector.

pub fn simple_lookup(&self, location: Location) -> Option<String>[src]

Get a simple description of a location.

For a country database this will be the country name, for the timezone database it will be the timezone ID.

pub fn lookup(&self, location: Location) -> ZoneLookup[src]

Perform a full database lookup for a location.

Auto Trait Implementations

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.