[−][src]Struct quickcfg::hierarchy::Data
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]
last_modified: Option<SystemTime>,
data: impl IntoIterator<Item = Mapping>
) -> Self
Construct a new set of hierarchical data.
pub fn load<'de, T>(&self, key: &str) -> Result<Option<T>, Error> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
Load the given key.
pub fn load_or_default<'de, T>(&self, key: &str) -> Result<T, Error> where
T: Default + Deserialize<'de>,
[src]
T: Default + Deserialize<'de>,
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]
T: Deserialize<'de>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,