Enum cln_plugin::options::Value
source · pub enum Value {
String(String),
Integer(i64),
Boolean(bool),
StringArray(Vec<String>),
IntegerArray(Vec<i64>),
}
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.
sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
If the Value
is a Boolean, returns the associated bool. Returns None
otherwise.
sourcepub fn is_str_arr(&self) -> bool
pub fn is_str_arr(&self) -> bool
Returns true if the Value
is a Vec
For any Value on which is_str_arr
returns true, as_str_arr
is
guaranteed to return the Vec
sourcepub fn as_str_arr(&self) -> Option<&Vec<String>>
pub fn as_str_arr(&self) -> Option<&Vec<String>>
If the Value
is a Vec
sourcepub fn is_i64_arr(&self) -> bool
pub fn is_i64_arr(&self) -> bool
Returns true if the Value
is a Vec
For any Value on which is_i64_arr
returns true, as_i64_arr
is
guaranteed to return the Vec
sourcepub fn as_i64_arr(&self) -> Option<&Vec<i64>>
pub fn as_i64_arr(&self) -> Option<&Vec<i64>>
If the Value
is a Vec
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Value
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)