pub enum OptionValue {
Bool(bool),
Int(i64),
Usize(usize),
Float(f64),
Str(String),
List(Vec<String>),
None,
}Expand description
Runtime value of a configuration option.
Variants§
Implementations§
Source§impl OptionValue
impl OptionValue
pub fn as_str(&self) -> Option<&str>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
pub fn as_bool(&self) -> Option<bool>
pub fn as_list(&self) -> Option<&Vec<String>>
pub fn as_usize(&self) -> usize
pub fn as_str_vec(&self) -> &[String]
pub fn is_none(&self) -> bool
pub fn parse_size_str(s: &str) -> u64
pub fn to_size_string(bytes: u64) -> String
Trait Implementations§
Source§impl Clone for OptionValue
impl Clone for OptionValue
Source§fn clone(&self) -> OptionValue
fn clone(&self) -> OptionValue
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 OptionValue
impl Debug for OptionValue
Source§impl Default for OptionValue
impl Default for OptionValue
Source§fn default() -> OptionValue
fn default() -> OptionValue
Returns the “default value” for a type. Read more
Source§impl Display for OptionValue
impl Display for OptionValue
Source§impl From<&OptionValue> for Value
impl From<&OptionValue> for Value
Source§fn from(v: &OptionValue) -> Self
fn from(v: &OptionValue) -> Self
Converts to this type from the input type.
Source§impl From<Value> for OptionValue
impl From<Value> for OptionValue
Source§impl PartialEq for OptionValue
impl PartialEq for OptionValue
impl StructuralPartialEq for OptionValue
Auto Trait Implementations§
impl Freeze for OptionValue
impl RefUnwindSafe for OptionValue
impl Send for OptionValue
impl Sync for OptionValue
impl Unpin for OptionValue
impl UnsafeUnpin for OptionValue
impl UnwindSafe for OptionValue
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