pub enum Shape {
Boolean(Position),
Int(Position),
Float(Position),
Str(Position),
Tuple(PositionedItem<TupleShape>),
List(NarrowedShape),
Func(FuncShapeDef),
Module(ModuleShape),
Hole(PositionedItem<Rc<str>>),
Narrowed(NarrowedShape),
Import(ImportShape),
TypeErr(Position, String),
}Expand description
Shapes represent the types that UCG values or expressions can have.
Variants§
Boolean(Position)
Int(Position)
Float(Position)
Str(Position)
Tuple(PositionedItem<TupleShape>)
List(NarrowedShape)
Func(FuncShapeDef)
Module(ModuleShape)
Hole(PositionedItem<Rc<str>>)
Narrowed(NarrowedShape)
Import(ImportShape)
TypeErr(Position, String)
Implementations§
Source§impl Shape
impl Shape
pub fn equivalent( &self, right: &Shape, symbol_table: &BTreeMap<Rc<str>, Shape>, ) -> bool
pub fn narrow( &self, right: &Shape, symbol_table: &mut BTreeMap<Rc<str>, Shape>, ) -> Self
pub fn type_name(&self) -> &'static str
pub fn pos(&self) -> &Position
pub fn with_pos(self, pos: Position) -> Self
Trait Implementations§
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl Freeze for Shape
impl RefUnwindSafe for Shape
impl !Send for Shape
impl !Sync for Shape
impl Unpin for Shape
impl UnsafeUnpin for Shape
impl UnwindSafe for Shape
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