Enum cln_plugin::options::Value
source · pub enum Value {
String(String),
Integer(i64),
Boolean(bool),
OptString,
OptInteger,
OptBoolean,
}Variants§
Implementations§
source§impl Value
impl Value
sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Returns true if the Value is a String. Returns false otherwise.
For any Value on which is_string returns true, as_str is guaranteed
to return the string slice.
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
If the Value is a String, returns the associated str. Returns None
otherwise.
sourcepub fn is_i64(&self) -> bool
pub fn is_i64(&self) -> bool
Returns true if the Value is an integer between i64::MIN and
i64::MAX.
For any Value on which is_i64 returns true, as_i64 is guaranteed to
return the integer value.
sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
If the Value is an integer, represent it as i64. Returns
None otherwise.
sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if the Value is a Boolean. Returns false otherwise.
For any Value on which is_boolean returns true, as_bool is
guaranteed to return the boolean value.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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