pub enum Type {
String,
Number,
Boolean,
Array(Box<Type>),
Object(HashMap<String, Type>),
Function {
parameters: Vec<Type>,
return_type: Box<Type>,
},
Any,
Null,
}Expand description
Type annotations
Variants§
String
String type
Number
Number type
Boolean
Boolean type
Array(Box<Type>)
Array type
Object(HashMap<String, Type>)
Object type
Function
Function type
Any
Any type
Null
Null type
Implementations§
Source§impl Type
impl Type
Sourcepub fn is_compatible_with(&self, other: &Type) -> bool
pub fn is_compatible_with(&self, other: &Type) -> bool
Check if this type is compatible with another type
Sourcepub fn default_value(&self) -> Value
pub fn default_value(&self) -> Value
Get the default value for this type
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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