pub enum Variable<'x> {
String(Cow<'x, str>),
Integer(i64),
Float(f64),
Array(Array<'x>),
}Variants§
Implementations§
Source§impl<'x> Variable<'x>
impl<'x> Variable<'x>
pub fn op_add(self, other: Variable<'x>) -> Variable<'x>
pub fn op_subtract(self, other: Variable<'x>) -> Variable<'x>
pub fn op_multiply(self, other: Variable<'x>) -> Variable<'x>
pub fn op_divide(self, other: Variable<'x>) -> Variable<'x>
pub fn op_and(self, other: Variable<'x>) -> Variable<'x>
pub fn op_or(self, other: Variable<'x>) -> Variable<'x>
pub fn op_xor(self, other: Variable<'x>) -> Variable<'x>
pub fn op_eq(self, other: Variable<'x>) -> Variable<'x>
pub fn op_ne(self, other: Variable<'x>) -> Variable<'x>
pub fn op_lt(self, other: Variable<'x>) -> Variable<'x>
pub fn op_le(self, other: Variable<'x>) -> Variable<'x>
pub fn op_gt(self, other: Variable<'x>) -> Variable<'x>
pub fn op_ge(self, other: Variable<'x>) -> Variable<'x>
pub fn op_not(self) -> Variable<'x>
pub fn op_minus(self) -> Variable<'x>
pub fn parse_number(&self) -> Variable<'x>
Source§impl<'x> Variable<'x>
impl<'x> Variable<'x>
pub const fn empty() -> Self
pub const fn borrowed(s: &'x str) -> Self
pub fn to_string(&self) -> Cow<'_, str>
pub fn into_string(self) -> Cow<'x, str>
pub fn as_str(&self) -> Option<&str>
pub fn to_number(&self) -> Number
pub fn to_number_checked(&self) -> Option<Number>
pub fn to_integer(&self) -> i64
pub fn to_usize(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_array(&self) -> Option<&[Variable<'x>]>
pub fn into_array(self) -> Array<'x>
pub fn to_array(&self) -> Cow<'_, [Variable<'x>]>
pub fn into_string_array(self) -> Vec<String>
pub fn to_string_array(&self) -> Vec<Cow<'_, str>>
pub fn into_owned(self) -> Variable<'static>
pub fn is_borrowed(&self) -> bool
pub fn to_bool(&self) -> bool
Trait Implementations§
impl Eq for Variable<'_>
Source§impl Ord for Variable<'_>
impl Ord for Variable<'_>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Auto Trait Implementations§
impl<'x> Freeze for Variable<'x>
impl<'x> RefUnwindSafe for Variable<'x>
impl<'x> Send for Variable<'x>
impl<'x> Sync for Variable<'x>
impl<'x> Unpin for Variable<'x>
impl<'x> UnsafeUnpin for Variable<'x>
impl<'x> UnwindSafe for Variable<'x>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.