pub enum PrefValue {
String(String),
Int(i32),
Bool(bool),
}Expand description
A setting value, returned by ValidContext::get_prefs.
Variants§
Implementations§
Source§impl PrefValue
impl PrefValue
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Projects this PrefValue as &str, if it is a String. Returns
None otherwise.
Sourcepub fn as_i32(&self) -> Option<i32>
pub fn as_i32(&self) -> Option<i32>
Projects this PrefValue as i32, if it is an Int. Returns
None otherwise.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Projects this PrefValue as bool, if it is a Bool. Returns
None otherwise.
Sourcepub fn into_string(self) -> Option<String>
pub fn into_string(self) -> Option<String>
Consumes this PrefValue and attempts to take a String out of
it.
Trait Implementations§
Source§impl Ord for PrefValue
impl Ord for PrefValue
Source§impl PartialOrd for PrefValue
impl PartialOrd for PrefValue
impl Eq for PrefValue
impl StructuralPartialEq for PrefValue
Auto Trait Implementations§
impl Freeze for PrefValue
impl RefUnwindSafe for PrefValue
impl Send for PrefValue
impl Sync for PrefValue
impl Unpin for PrefValue
impl UnwindSafe for PrefValue
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