pub enum Ty {
TypeExpr(TypeExpr),
Function(TyFunc),
Table(Frame),
Infer,
}
Variants§
TypeExpr(TypeExpr)
Value is an element of this [SetExpr]
Function(TyFunc)
Value is a function described by TyFunc
Table(Frame)
Special type for relations.
Infer
Means that we have no information about the type of the variable and that it should be inferred from other usages.
Implementations§
source§impl Ty
impl Ty
sourcepub fn as_type_expr_mut(&mut self) -> Option<&mut TypeExpr>
pub fn as_type_expr_mut(&mut self) -> Option<&mut TypeExpr>
Optionally returns mutable references to the inner fields if this is a Ty::TypeExpr
, otherwise None
sourcepub fn as_type_expr(&self) -> Option<&TypeExpr>
pub fn as_type_expr(&self) -> Option<&TypeExpr>
Optionally returns references to the inner fields if this is a Ty::TypeExpr
, otherwise None
sourcepub fn into_type_expr(self) -> Result<TypeExpr, Self>
pub fn into_type_expr(self) -> Result<TypeExpr, Self>
Returns the inner fields if this is a Ty::TypeExpr
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_function_mut(&mut self) -> Option<&mut TyFunc>
pub fn as_function_mut(&mut self) -> Option<&mut TyFunc>
Optionally returns mutable references to the inner fields if this is a Ty::Function
, otherwise None
sourcepub fn as_function(&self) -> Option<&TyFunc>
pub fn as_function(&self) -> Option<&TyFunc>
Optionally returns references to the inner fields if this is a Ty::Function
, otherwise None
sourcepub fn into_function(self) -> Result<TyFunc, Self>
pub fn into_function(self) -> Result<TyFunc, Self>
Returns the inner fields if this is a Ty::Function
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_table_mut(&mut self) -> Option<&mut Frame>
pub fn as_table_mut(&mut self) -> Option<&mut Frame>
Optionally returns mutable references to the inner fields if this is a Ty::Table
, otherwise None
sourcepub fn as_table(&self) -> Option<&Frame>
pub fn as_table(&self) -> Option<&Frame>
Optionally returns references to the inner fields if this is a Ty::Table
, otherwise None
sourcepub fn into_table(self) -> Result<Frame, Self>
pub fn into_table(self) -> Result<Frame, Self>
Returns the inner fields if this is a Ty::Table
, otherwise returns back the enum in the Err
case of the result