[][src]Struct hdd::drivedb::Loader

pub struct Loader { /* fields omitted */ }

Use this helper to load entries from drivedb.h.

It is also possible to use Loader to create dummy database in case if only user-defined attributes (or none at all) are needed: just call db() right after creating the loader.

Implementations

impl Loader[src]

pub fn new() -> Self[src]

pub fn load(&mut self, file: &str) -> Result<(), Error>[src]

Loads entries from main drivedb file.

Entries from previously loaded main file will be discarded; entries from additional files will not be affected.

Errors

Returns enum Error if:

  • it encounters any kind of I/O error,
  • drive database is malformed.

pub fn load_additional(&mut self, file: &str) -> Result<(), Error>[src]

Loads more entries from additional drivedb file. Additional entries always take precedence over the ones from the main file.

Errors

Returns enum Error if:

  • it encounters any kind of I/O error,
  • drive database is malformed.

pub fn db(self) -> DriveDB[src]

Returns actual drive database with all entries loaded beforehand.

Trait Implementations

impl Debug for Loader[src]

Auto Trait Implementations

impl RefUnwindSafe for Loader

impl Send for Loader

impl Sync for Loader

impl Unpin for Loader

impl UnwindSafe for Loader

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.