pub enum Model {
}Expand description
The elements of a type’s value
Variants§
Integer
Float
Bool
A bool
Char
A char
Str
A str
Any
Any type. A placeholder wildcard type
Never
The “never” type (no variants)
Unit(usize)
The unit type (no elements)
Ref(Type)
Reference to a value of Type
Slice(Type)
Slice of a list of Type
Tuple(Option<Symbol>, Box<[Type]>)
The elements of a tuple
Struct(Option<Symbol>, Box<[(Symbol, Type)]>, bool)
The elements of a struct, and whether they are exhaustive
Enum(Symbol, Box<[(Symbol, Type)]>)
The variants of an enumeration
Implementations§
Source§impl Model
impl Model
pub fn intern(self) -> Type
pub fn already_interned(&self) -> Type
pub fn default_integer() -> Type
pub fn default_float() -> Type
pub fn with_name(self, name: Symbol) -> Self
pub fn name(&self) -> &'static str
pub fn make_tuple(&self, values: Box<[ConValue]>) -> IResult<ConValue>
pub fn make_struct( &self, values: HashMap<Symbol, ConValue>, ) -> IResult<ConValue>
pub fn defaults() -> Vec<(&'static str, Self)>
pub fn getattr(&self, attr: Symbol) -> IResult<ConValue>
Trait Implementations§
Source§impl Callable for Model
impl Callable for Model
Source§fn call(&self, env: &mut Environment, args: &[ConValue]) -> IResult<ConValue>
fn call(&self, env: &mut Environment, args: &[ConValue]) -> IResult<ConValue>
Calls this Callable in the provided Environment, with ConValue args
The Callable is responsible for checking the argument count and validating types
The Callable is responsible for checking the argument count and validating types
impl Eq for Model
Source§impl Ord for Model
impl Ord for Model
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
Source§impl PartialOrd for Model
impl PartialOrd for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
Blanket Implementations§
impl<T> AstNode for T
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