pub struct Configuration {
pub base: Properties,
pub tags: HashMap<String, Properties>,
}Expand description
Configuration of a jobber database.
Fields§
§base: PropertiesConfiguration used when no tag related configuration fit
Configuration by tag
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn set(&mut self, tags: &Option<TagSet>, update: &Properties) -> bool
pub fn set(&mut self, tags: &Option<TagSet>, update: &Properties) -> bool
Partially overwrite properties of configurations which match the given tags.
Sourcepub fn get_and_why(&self, tags: &TagSet) -> (Option<String>, &Properties)
pub fn get_and_why(&self, tags: &TagSet) -> (Option<String>, &Properties)
get properties for the given tags and additionally return which tag was relevant
Sourcepub fn get(&self, tags: &TagSet) -> &Properties
pub fn get(&self, tags: &TagSet) -> &Properties
get properties for the given tags
Sourcepub fn get_checked(&self, tags: &TagSet) -> Result<&Properties, Error>
pub fn get_checked(&self, tags: &TagSet) -> Result<&Properties, Error>
get properties for the given tags and also check tag configuration consistency
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Configuration
impl Debug for Configuration
Source§impl Default for Configuration
impl Default for Configuration
Source§fn default() -> Configuration
fn default() -> Configuration
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Configuration
impl<'de> Deserialize<'de> for Configuration
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnsafeUnpin for Configuration
impl UnwindSafe for Configuration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more