pub enum DeclKind {
Module(Module),
LayeredModules(Vec<Module>),
TableDecl(TableDecl),
InstanceOf(Ident, Option<Ty>),
Column(usize),
Infer(Box<DeclKind>),
Expr(Box<Expr>),
Ty(Ty),
QueryDef(QueryDef),
}
Expand description
The Declaration itself.
Variants§
Module(Module)
A nested namespace
LayeredModules(Vec<Module>)
Nested namespaces that do lookup in layers from top to bottom, stopping at first match.
TableDecl(TableDecl)
InstanceOf(Ident, Option<Ty>)
Column(usize)
A single column. Contains id of target which is either:
- an input relation that is source of this column or
- a column expression.
Infer(Box<DeclKind>)
Contains a default value to be created in parent namespace when NS_INFER is matched.
Expr(Box<Expr>)
Ty(Ty)
QueryDef(QueryDef)
Implementations§
source§impl DeclKind
impl DeclKind
sourcepub fn as_module_mut(&mut self) -> Option<&mut Module>
pub fn as_module_mut(&mut self) -> Option<&mut Module>
Optionally returns mutable references to the inner fields if this is a DeclKind::Module
, otherwise None
sourcepub fn as_module(&self) -> Option<&Module>
pub fn as_module(&self) -> Option<&Module>
Optionally returns references to the inner fields if this is a DeclKind::Module
, otherwise None
sourcepub fn into_module(self) -> Result<Module, Self>
pub fn into_module(self) -> Result<Module, Self>
Returns the inner fields if this is a DeclKind::Module
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_layered_modules(&self) -> bool
pub fn is_layered_modules(&self) -> bool
Returns true if this is a DeclKind::LayeredModules
, otherwise false
sourcepub fn as_layered_modules_mut(&mut self) -> Option<&mut Vec<Module>>
pub fn as_layered_modules_mut(&mut self) -> Option<&mut Vec<Module>>
Optionally returns mutable references to the inner fields if this is a DeclKind::LayeredModules
, otherwise None
sourcepub fn as_layered_modules(&self) -> Option<&Vec<Module>>
pub fn as_layered_modules(&self) -> Option<&Vec<Module>>
Optionally returns references to the inner fields if this is a DeclKind::LayeredModules
, otherwise None
sourcepub fn into_layered_modules(self) -> Result<Vec<Module>, Self>
pub fn into_layered_modules(self) -> Result<Vec<Module>, Self>
Returns the inner fields if this is a DeclKind::LayeredModules
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_table_decl(&self) -> bool
pub fn is_table_decl(&self) -> bool
Returns true if this is a DeclKind::TableDecl
, otherwise false
sourcepub fn as_table_decl_mut(&mut self) -> Option<&mut TableDecl>
pub fn as_table_decl_mut(&mut self) -> Option<&mut TableDecl>
Optionally returns mutable references to the inner fields if this is a DeclKind::TableDecl
, otherwise None
sourcepub fn as_table_decl(&self) -> Option<&TableDecl>
pub fn as_table_decl(&self) -> Option<&TableDecl>
Optionally returns references to the inner fields if this is a DeclKind::TableDecl
, otherwise None
sourcepub fn into_table_decl(self) -> Result<TableDecl, Self>
pub fn into_table_decl(self) -> Result<TableDecl, Self>
Returns the inner fields if this is a DeclKind::TableDecl
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_instance_of(&self) -> bool
pub fn is_instance_of(&self) -> bool
Returns true if this is a DeclKind::InstanceOf
, otherwise false
sourcepub fn as_instance_of_mut(&mut self) -> Option<(&mut Ident, &mut Option<Ty>)>
pub fn as_instance_of_mut(&mut self) -> Option<(&mut Ident, &mut Option<Ty>)>
Optionally returns mutable references to the inner fields if this is a DeclKind::InstanceOf
, otherwise None
sourcepub fn as_instance_of(&self) -> Option<(&Ident, &Option<Ty>)>
pub fn as_instance_of(&self) -> Option<(&Ident, &Option<Ty>)>
Optionally returns references to the inner fields if this is a DeclKind::InstanceOf
, otherwise None
sourcepub fn into_instance_of(self) -> Result<(Ident, Option<Ty>), Self>
pub fn into_instance_of(self) -> Result<(Ident, Option<Ty>), Self>
Returns the inner fields if this is a DeclKind::InstanceOf
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_column_mut(&mut self) -> Option<&mut usize>
pub fn as_column_mut(&mut self) -> Option<&mut usize>
Optionally returns mutable references to the inner fields if this is a DeclKind::Column
, otherwise None
sourcepub fn as_column(&self) -> Option<&usize>
pub fn as_column(&self) -> Option<&usize>
Optionally returns references to the inner fields if this is a DeclKind::Column
, otherwise None
sourcepub fn into_column(self) -> Result<usize, Self>
pub fn into_column(self) -> Result<usize, Self>
Returns the inner fields if this is a DeclKind::Column
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_infer_mut(&mut self) -> Option<&mut Box<DeclKind>>
pub fn as_infer_mut(&mut self) -> Option<&mut Box<DeclKind>>
Optionally returns mutable references to the inner fields if this is a DeclKind::Infer
, otherwise None
sourcepub fn as_infer(&self) -> Option<&Box<DeclKind>>
pub fn as_infer(&self) -> Option<&Box<DeclKind>>
Optionally returns references to the inner fields if this is a DeclKind::Infer
, otherwise None
sourcepub fn into_infer(self) -> Result<Box<DeclKind>, Self>
pub fn into_infer(self) -> Result<Box<DeclKind>, Self>
Returns the inner fields if this is a DeclKind::Infer
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_expr_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_expr_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a DeclKind::Expr
, otherwise None
sourcepub fn as_expr(&self) -> Option<&Box<Expr>>
pub fn as_expr(&self) -> Option<&Box<Expr>>
Optionally returns references to the inner fields if this is a DeclKind::Expr
, otherwise None
sourcepub fn into_expr(self) -> Result<Box<Expr>, Self>
pub fn into_expr(self) -> Result<Box<Expr>, Self>
Returns the inner fields if this is a DeclKind::Expr
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_ty_mut(&mut self) -> Option<&mut Ty>
pub fn as_ty_mut(&mut self) -> Option<&mut Ty>
Optionally returns mutable references to the inner fields if this is a DeclKind::Ty
, otherwise None
sourcepub fn as_ty(&self) -> Option<&Ty>
pub fn as_ty(&self) -> Option<&Ty>
Optionally returns references to the inner fields if this is a DeclKind::Ty
, otherwise None
sourcepub fn into_ty(self) -> Result<Ty, Self>
pub fn into_ty(self) -> Result<Ty, Self>
Returns the inner fields if this is a DeclKind::Ty
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_query_def(&self) -> bool
pub fn is_query_def(&self) -> bool
Returns true if this is a DeclKind::QueryDef
, otherwise false
sourcepub fn as_query_def_mut(&mut self) -> Option<&mut QueryDef>
pub fn as_query_def_mut(&mut self) -> Option<&mut QueryDef>
Optionally returns mutable references to the inner fields if this is a DeclKind::QueryDef
, otherwise None
sourcepub fn as_query_def(&self) -> Option<&QueryDef>
pub fn as_query_def(&self) -> Option<&QueryDef>
Optionally returns references to the inner fields if this is a DeclKind::QueryDef
, otherwise None
sourcepub fn into_query_def(self) -> Result<QueryDef, Self>
pub fn into_query_def(self) -> Result<QueryDef, Self>
Returns the inner fields if this is a DeclKind::QueryDef
, otherwise returns back the enum in the Err
case of the result