pub struct TraitDecl {
pub docs: Vec<Spanned<String>>,
pub attrs: Vec<Attribute>,
pub vis: Visibility,
pub name: Spanned<String>,
pub generics: Vec<TypeParam>,
pub supertraits: Vec<Spanned<Path>>,
pub where_clause: Vec<WhereBound>,
pub items: Vec<TraitItem>,
}Expand description
A trait declaration.
Fields§
§docs: Vec<Spanned<String>>The /// lines before it, one entry per line, holding the text after
the /// (spec
docs/superpowers/specs/2026-10-07-phase-3-1-formatter-design.md §4).
attrs: Vec<Attribute>§vis: Visibility§name: Spanned<String>§generics: Vec<TypeParam>§supertraits: Vec<Spanned<Path>>§where_clause: Vec<WhereBound>A where clause on the trait itself (e.g. trait B where Self: A), as
opposed to the trait B: A shorthand (stored in supertraits). Parsed
but not otherwise supported yet — nova-typeck reports E0900 for a
non-empty clause here rather than acting on it.
items: Vec<TraitItem>Trait Implementations§
Auto Trait Implementations§
impl Freeze for TraitDecl
impl RefUnwindSafe for TraitDecl
impl Send for TraitDecl
impl Sync for TraitDecl
impl Unpin for TraitDecl
impl UnsafeUnpin for TraitDecl
impl UnwindSafe for TraitDecl
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