pub struct TraitDecl {
pub name: Ident,
pub type_params: Vec<TypeParam>,
pub super_traits: Vec<TypeExpr>,
pub methods: Vec<FnSig>,
}Expand description
Trait declaration: trait Numeric { fn zero() -> Self; }
Traits define abstract interfaces via method signatures.
Implementors provide concrete method bodies via ImplDecl.
Fields§
§name: IdentTrait name.
type_params: Vec<TypeParam>Generic type parameters.
super_traits: Vec<TypeExpr>Super-trait bounds this trait extends.
methods: Vec<FnSig>Method signatures (no bodies).
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