Enum value_trait::StaticNode
source · Expand description
Static tape node
Variants
I64(i64)
A signed 64 bit integer.
U64(u64)
An unsigned 64 bit integer.
F64(f64)
A floating point value
Bool(bool)
A boolean value
Null
The null value
Trait Implementations
sourceimpl Clone for StaticNode
impl Clone for StaticNode
sourcefn clone(&self) -> StaticNode
fn clone(&self) -> StaticNode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for StaticNode
impl Debug for StaticNode
sourceimpl Default for StaticNode
impl Default for StaticNode
sourceimpl Display for StaticNode
impl Display for StaticNode
sourceimpl From<()> for StaticNode
impl From<()> for StaticNode
sourceimpl From<bool> for StaticNode
impl From<bool> for StaticNode
sourceimpl From<f32> for StaticNode
impl From<f32> for StaticNode
sourceimpl From<f64> for StaticNode
impl From<f64> for StaticNode
sourceimpl From<i16> for StaticNode
impl From<i16> for StaticNode
sourceimpl From<i32> for StaticNode
impl From<i32> for StaticNode
sourceimpl From<i64> for StaticNode
impl From<i64> for StaticNode
sourceimpl From<i8> for StaticNode
impl From<i8> for StaticNode
sourceimpl From<u16> for StaticNode
impl From<u16> for StaticNode
sourceimpl From<u32> for StaticNode
impl From<u32> for StaticNode
sourceimpl From<u64> for StaticNode
impl From<u64> for StaticNode
sourceimpl From<u8> for StaticNode
impl From<u8> for StaticNode
sourceimpl From<usize> for StaticNode
impl From<usize> for StaticNode
sourceimpl Index<&str> for StaticNode
impl Index<&str> for StaticNode
sourceimpl Index<usize> for StaticNode
impl Index<usize> for StaticNode
sourceimpl IndexMut<&str> for StaticNode
impl IndexMut<&str> for StaticNode
sourceimpl IndexMut<usize> for StaticNode
impl IndexMut<usize> for StaticNode
sourceimpl PartialEq<StaticNode> for StaticNode
impl PartialEq<StaticNode> for StaticNode
sourceimpl Value for StaticNode
impl Value for StaticNode
sourcefn is_integer(&self) -> bool
fn is_integer(&self) -> bool
returns true if the current value a integer number
sourcefn is_f64_castable(&self) -> bool
fn is_f64_castable(&self) -> bool
returns true if the current value can be cast into a f64
sourceimpl ValueAccess for StaticNode
impl ValueAccess for StaticNode
type Target = StaticNode
type Target = StaticNode
The target for nested lookups
type Array = Vec<StaticNode, Global>
type Array = Vec<StaticNode, Global>
The array structure
type Object = HashMap<String, StaticNode, RandomState>
type Object = HashMap<String, StaticNode, RandomState>
The object structure
sourcefn value_type(&self) -> ValueType
fn value_type(&self) -> ValueType
Gets the type of the current value
sourcefn as_array(&self) -> Option<&Self::Array>
fn as_array(&self) -> Option<&Self::Array>
Tries to represent the value as an array and returns a refference to it
sourcefn as_object(&self) -> Option<&HashMap<Self::Key, Self>>
fn as_object(&self) -> Option<&HashMap<Self::Key, Self>>
Tries to represent the value as an object and returns a refference to it
sourcefn cast_f64(&self) -> Option<f64>
fn cast_f64(&self) -> Option<f64>
Casts the current value to a f64 if possible, this will turn integer
values into floats. Read more
sourcefn try_as_bool(&self) -> Result<bool, TryTypeError>
fn try_as_bool(&self) -> Result<bool, TryTypeError>
Tries to represent the value as a bool Read more
sourcefn try_as_i128(&self) -> Result<i128, TryTypeError>
fn try_as_i128(&self) -> Result<i128, TryTypeError>
Tries to represent the value as a i128 Read more
sourcefn try_as_i64(&self) -> Result<i64, TryTypeError>
fn try_as_i64(&self) -> Result<i64, TryTypeError>
Tries to represent the value as an i64 Read more
sourcefn try_as_i32(&self) -> Result<i32, TryTypeError>
fn try_as_i32(&self) -> Result<i32, TryTypeError>
Tries to represent the value as an i32 Read more
sourcefn try_as_i16(&self) -> Result<i16, TryTypeError>
fn try_as_i16(&self) -> Result<i16, TryTypeError>
Tries to represent the value as an i16 Read more
sourcefn try_as_i8(&self) -> Result<i8, TryTypeError>
fn try_as_i8(&self) -> Result<i8, TryTypeError>
Tries to represent the value as an i8 Read more
sourcefn try_as_u128(&self) -> Result<u128, TryTypeError>
fn try_as_u128(&self) -> Result<u128, TryTypeError>
Tries to represent the value as an u128 Read more
sourcefn try_as_u64(&self) -> Result<u64, TryTypeError>
fn try_as_u64(&self) -> Result<u64, TryTypeError>
Tries to represent the value as an u64 Read more
sourcefn try_as_usize(&self) -> Result<usize, TryTypeError>
fn try_as_usize(&self) -> Result<usize, TryTypeError>
Tries to represent the value as an usize Read more
sourcefn try_as_u32(&self) -> Result<u32, TryTypeError>
fn try_as_u32(&self) -> Result<u32, TryTypeError>
Tries to represent the value as an u32 Read more
sourcefn try_as_u16(&self) -> Result<u16, TryTypeError>
fn try_as_u16(&self) -> Result<u16, TryTypeError>
Tries to represent the value as an u16 Read more
sourcefn try_as_u8(&self) -> Result<u8, TryTypeError>
fn try_as_u8(&self) -> Result<u8, TryTypeError>
Tries to represent the value as an u8 Read more
sourcefn try_as_f64(&self) -> Result<f64, TryTypeError>
fn try_as_f64(&self) -> Result<f64, TryTypeError>
Tries to represent the value as a f64 Read more
sourcefn try_cast_f64(&self) -> Result<f64, TryTypeError>
fn try_cast_f64(&self) -> Result<f64, TryTypeError>
Tries to Casts the current value to a f64 if possible, this will turn integer
values into floats and error if it isn’t possible Read more
sourcefn try_as_f32(&self) -> Result<f32, TryTypeError>
fn try_as_f32(&self) -> Result<f32, TryTypeError>
Tries to represent the value as a f32 Read more
sourcefn try_as_str(&self) -> Result<&str, TryTypeError>
fn try_as_str(&self) -> Result<&str, TryTypeError>
Tries to represent the value as a &str Read more
sourcefn try_as_char(&self) -> Result<char, TryTypeError>
fn try_as_char(&self) -> Result<char, TryTypeError>
Tries to represent the value as a Char Read more
sourcefn try_as_array(&self) -> Result<&Self::Array, TryTypeError>
fn try_as_array(&self) -> Result<&Self::Array, TryTypeError>
Tries to represent the value as an array and returns a refference to it Read more
sourcefn try_as_object(&self) -> Result<&Self::Object, TryTypeError>
fn try_as_object(&self) -> Result<&Self::Object, TryTypeError>
Tries to represent the value as an object and returns a refference to it Read more
sourcefn get_idx(&self, i: usize) -> Option<&Self::Target>
fn get_idx(&self, i: usize) -> Option<&Self::Target>
Gets a ref to a value based on n index, returns
None
if the
current Value isn’t an Array or doesn’t contain the index
it was asked for. Read moresourcefn try_get_idx(&self, i: usize) -> Result<Option<&Self::Target>, TryTypeError>
fn try_get_idx(&self, i: usize) -> Result<Option<&Self::Target>, TryTypeError>
Tries to get a value based on n index, returns a type error if the
current value isn’t an Array, returns
None
if the index is out of bouds Read moreimpl Copy for StaticNode
Auto Trait Implementations
impl RefUnwindSafe for StaticNode
impl Send for StaticNode
impl Sync for StaticNode
impl Unpin for StaticNode
impl UnwindSafe for StaticNode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more