pub enum VariableType {
Any,
Null,
Bool,
String,
Number,
Date,
Interval,
Array(Rc<VariableType>),
Object(Rc<RefCell<HashMap<Rc<str>, VariableType, RandomState>>>),
Const(Rc<str>),
Enum(Option<Rc<str>>, Vec<Rc<str>>),
}
Variants§
Any
Null
Bool
String
Number
Date
Interval
Array(Rc<VariableType>)
Object(Rc<RefCell<HashMap<Rc<str>, VariableType, RandomState>>>)
Const(Rc<str>)
Enum(Option<Rc<str>>, Vec<Rc<str>>)
Implementations§
Source§impl VariableType
impl VariableType
pub fn iterator(&self) -> Option<Rc<VariableType>>
pub fn as_const_str(&self) -> Option<Rc<str>>
pub fn get(&self, key: &str) -> VariableType
pub fn satisfies(&self, constraint: &VariableType) -> bool
pub fn is_array(&self) -> bool
pub fn is_iterable(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_object(&self) -> bool
pub fn is_null(&self) -> bool
pub fn widen(&self) -> VariableType
pub fn merge(&self, other: &VariableType) -> VariableType
pub fn shallow_clone(&self) -> VariableType
pub fn dot_head(&self, key: &str) -> Option<VariableType>
pub fn dot_head_detach(&self, key: &str) -> (VariableType, Option<VariableType>)
pub fn depth_clone(&self, depth: usize) -> VariableType
pub fn empty_object() -> VariableType
pub fn dot_insert_detached( &self, key: &str, variable: VariableType, ) -> Option<VariableType>
pub fn dot_insert( &self, key: &str, variable: VariableType, ) -> Option<VariableType>
pub fn dot(&self, key: &str) -> Option<VariableType>
Source§impl VariableType
impl VariableType
pub fn array(self) -> VariableType
Trait Implementations§
Source§impl Clone for VariableType
impl Clone for VariableType
Source§fn clone(&self) -> VariableType
fn clone(&self) -> VariableType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VariableType
impl Debug for VariableType
Source§impl Default for VariableType
impl Default for VariableType
Source§fn default() -> VariableType
fn default() -> VariableType
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for VariableType
impl<'de> Deserialize<'de> for VariableType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<VariableType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<VariableType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for VariableType
impl Display for VariableType
Source§impl From<&Value> for VariableType
impl From<&Value> for VariableType
Source§fn from(value: &Value) -> VariableType
fn from(value: &Value) -> VariableType
Converts to this type from the input type.
Source§impl From<Value> for VariableType
impl From<Value> for VariableType
Source§fn from(value: Value) -> VariableType
fn from(value: Value) -> VariableType
Converts to this type from the input type.
Source§impl Hash for VariableType
impl Hash for VariableType
Source§impl PartialEq for VariableType
impl PartialEq for VariableType
Source§impl Serialize for VariableType
impl Serialize for VariableType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for VariableType
impl StructuralPartialEq for VariableType
Auto Trait Implementations§
impl Freeze for VariableType
impl !RefUnwindSafe for VariableType
impl !Send for VariableType
impl !Sync for VariableType
impl Unpin for VariableType
impl !UnwindSafe for VariableType
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