pub enum ConfigValue<T: Clone> {
NotSpecified,
DontSet,
Value(T),
}Variants§
Implementations§
Source§impl<T: Clone> ConfigValue<T>
impl<T: Clone> ConfigValue<T>
pub fn from_option(v: Option<T>) -> Self
Sourcepub fn unwrap_or(&self, n: T) -> Option<T>
pub fn unwrap_or(&self, n: T) -> Option<T>
Converts an ConfigValue into an Option, leaving DontSet as None.
pub fn or(&self, n: Option<T>) -> Option<T>
pub fn as_ref(&self) -> ConfigValue<&T>
pub fn base_default(&self, n: T) -> Option<T>
pub fn always_unwrap_or(&self, n: T) -> T
pub fn apply_default(&self, n: ConfigValue<T>) -> ConfigValue<T>
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for ConfigValue<T>
impl<T: Clone + Clone> Clone for ConfigValue<T>
Source§fn clone(&self) -> ConfigValue<T>
fn clone(&self) -> ConfigValue<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Clone> Default for ConfigValue<T>
impl<T: Clone> Default for ConfigValue<T>
Source§fn default() -> ConfigValue<T>
fn default() -> ConfigValue<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for ConfigValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for ConfigValue<T>where
T: RefUnwindSafe,
impl<T> Send for ConfigValue<T>where
T: Send,
impl<T> Sync for ConfigValue<T>where
T: Sync,
impl<T> Unpin for ConfigValue<T>where
T: Unpin,
impl<T> UnsafeUnpin for ConfigValue<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ConfigValue<T>where
T: UnwindSafe,
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