[][src]Struct quickcfg::hierarchy::Data

pub struct Data {
    pub last_modified: Option<SystemTime>,
    // some fields omitted
}

Wrapper for hierarchy data.

Fields

last_modified: Option<SystemTime>

The last modification timestamp for a file in the hierarchy.

Methods

impl Data[src]

pub fn new(
    last_modified: Option<SystemTime>,
    data: impl IntoIterator<Item = Mapping>
) -> Self
[src]

Construct a new set of hierarchical data.

pub fn load<'de, T>(&self, key: &str) -> Result<Option<T>, Error> where
    T: Deserialize<'de>, 
[src]

Load the given key.

pub fn load_or_default<'de, T>(&self, key: &str) -> Result<T, Error> where
    T: Default + Deserialize<'de>, 
[src]

Load the given key, if it doesn't exist, use a default value.

pub fn load_array<'de, T>(&self, key: &str) -> Result<Vec<T>, Error> where
    T: Deserialize<'de>, 
[src]

Load the given key, if it doesn't exist, use a default value.

pub fn load_from_spec(&self, content: &str) -> Result<Mapping, Error>[src]

Load data based on a file spec. This is typically in the first couple of lines in a file.

Auto Trait Implementations

impl RefUnwindSafe for Data

impl Send for Data

impl Sync for Data

impl Unpin for Data

impl UnwindSafe for Data

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.