pub struct Trait { /* private fields */ }Expand description
Define a trait.
Implementations§
Source§impl Trait
impl Trait
Sourcepub fn bound<T>(&mut self, name: impl ToString, ty: T) -> &mut Self
pub fn bound<T>(&mut self, name: impl ToString, ty: T) -> &mut Self
Add a where bound to the trait.
Sourcepub fn macro(&mut self, macro: impl ToString) -> &mut Self
pub fn macro(&mut self, macro: impl ToString) -> &mut Self
Add a macro to the trait def (e.g. "#[async_trait]")
Sourcepub fn associated_const<T>(
&mut self,
name: impl ToString,
ty: T,
) -> &mut AssociatedConst
pub fn associated_const<T>( &mut self, name: impl ToString, ty: T, ) -> &mut AssociatedConst
Add an associated const. Returns a mutable reference to the new associated const for futher configuration.
Sourcepub fn associated_type(&mut self, name: impl ToString) -> &mut AssociatedType
pub fn associated_type(&mut self, name: impl ToString) -> &mut AssociatedType
Add an associated type. Returns a mutable reference to the new associated type for futher configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trait
impl RefUnwindSafe for Trait
impl Send for Trait
impl Sync for Trait
impl Unpin for Trait
impl UnwindSafe for Trait
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