pub enum Decl {
Show 18 variants
Axiom {
name: String,
univ_params: Vec<String>,
ty: Located<SurfaceExpr>,
attrs: Vec<AttributeKind>,
},
Definition {
name: String,
univ_params: Vec<String>,
ty: Option<Located<SurfaceExpr>>,
val: Located<SurfaceExpr>,
where_clauses: Vec<WhereClause>,
attrs: Vec<AttributeKind>,
},
Theorem {
name: String,
univ_params: Vec<String>,
ty: Located<SurfaceExpr>,
proof: Located<SurfaceExpr>,
where_clauses: Vec<WhereClause>,
attrs: Vec<AttributeKind>,
},
Inductive {
name: String,
univ_params: Vec<String>,
params: Vec<Binder>,
indices: Vec<Binder>,
ty: Located<SurfaceExpr>,
ctors: Vec<Constructor>,
},
Import {
path: Vec<String>,
},
Namespace {
name: String,
decls: Vec<Located<Decl>>,
},
Structure {
name: String,
univ_params: Vec<String>,
extends: Vec<String>,
fields: Vec<FieldDecl>,
},
ClassDecl {
name: String,
univ_params: Vec<String>,
extends: Vec<String>,
fields: Vec<FieldDecl>,
},
InstanceDecl {
name: Option<String>,
class_name: String,
ty: Located<SurfaceExpr>,
defs: Vec<(String, Located<SurfaceExpr>)>,
},
SectionDecl {
name: String,
decls: Vec<Located<Decl>>,
},
Variable {
binders: Vec<Binder>,
},
Open {
path: Vec<String>,
names: Vec<String>,
},
Attribute {
attrs: Vec<String>,
decl: Box<Located<Decl>>,
},
HashCmd {
cmd: String,
arg: Located<SurfaceExpr>,
},
Mutual {
decls: Vec<Located<Decl>>,
},
Derive {
instances: Vec<String>,
type_name: String,
},
NotationDecl {
kind: AstNotationKind,
prec: Option<u32>,
name: String,
notation: String,
},
Universe {
names: Vec<String>,
},
}Expand description
Top-level declaration.
Variants§
Axiom
Axiom declaration
Definition
Definition
Fields
§
ty: Option<Located<SurfaceExpr>>Type (optional, can be inferred)
§
val: Located<SurfaceExpr>Value
§
where_clauses: Vec<WhereClause>Where clauses (local definitions)
§
attrs: Vec<AttributeKind>Attributes
Theorem
Theorem
Fields
§
ty: Located<SurfaceExpr>Type (statement)
§
proof: Located<SurfaceExpr>Proof
§
where_clauses: Vec<WhereClause>Where clauses (local definitions)
§
attrs: Vec<AttributeKind>Attributes
Inductive
Inductive type
Import
Import declaration
Namespace
Namespace declaration
Structure
Structure declaration
Fields
ClassDecl
Class declaration
Fields
InstanceDecl
Instance declaration
Fields
§
ty: Located<SurfaceExpr>The instance type
§
defs: Vec<(String, Located<SurfaceExpr>)>Method definitions
SectionDecl
Section declaration
Variable
Variable declaration
Open
Open declaration
Attribute
Attribute declaration
HashCmd
Hash command (#check, #eval, #print)
Fields
§
arg: Located<SurfaceExpr>Argument expression
Mutual
Mutual recursive definitions
Derive
Derive declaration: deriving instance1, instance2 for TypeName
Fields
NotationDecl
Notation declaration
Fields
§
kind: AstNotationKindKind of notation
Universe
Universe declaration: universe u v w
Implementations§
Trait Implementations§
impl StructuralPartialEq for Decl
Auto Trait Implementations§
impl Freeze for Decl
impl RefUnwindSafe for Decl
impl Send for Decl
impl Sync for Decl
impl Unpin for Decl
impl UnsafeUnpin for Decl
impl UnwindSafe for Decl
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