pub enum Decl {
Template(TemplateDecl),
Interface(InterfaceDecl),
Function(FunctionDecl),
TypeDef {
keyword: String,
name: String,
constructors: Vec<DataConstructor>,
synonym: Option<Type>,
deriving: Vec<String>,
pos: Pos,
span: Span,
},
Unknown {
raw: String,
pos: Pos,
span: Span,
},
}Variants§
Template(TemplateDecl)
Interface(InterfaceDecl)
Function(FunctionDecl)
TypeDef
data/type/class/instance/exception — recorded with name + span.
Fields
§
constructors: Vec<DataConstructor>Constructors of a data/newtype declaration, structured. Empty for
type synonyms, class/instance/exception, and any body that
did not parse cleanly (the decl stays opaque, as before).
§
synonym: Option<Type>Aliased type of a type synonym (type Name = T), structured.
None for non-synonyms or an unparseable right-hand side.
Unknown
Anything unparseable at the top level (diagnostic already emitted).
Trait Implementations§
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