pub struct Trait { /* private fields */ }
Expand description
Define a trait.
Implementations
sourceimpl Trait
impl Trait
sourcepub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
pub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
Add a where
bound to the trait.
sourcepub fn macro(&mut self, macro: &str) -> &mut Self
pub fn macro(&mut self, macro: &str) -> &mut Self
Add a macro to the trait def (e.g. "#[async_trait]"
)
sourcepub fn associated_const<T>(
&mut self,
name: impl Into<String>,
ty: T
) -> &mut AssociatedConstwhere
T: Into<Type>,
pub fn associated_const<T>(
&mut self,
name: impl Into<String>,
ty: T
) -> &mut AssociatedConstwhere
T: Into<Type>,
Add an associated const. Returns a mutable reference to the new associated const for futher configuration.
sourcepub fn associated_type(&mut self, name: &str) -> &mut AssociatedType
pub fn associated_type(&mut self, name: &str) -> &mut AssociatedType
Add an associated type. Returns a mutable reference to the new associated type for futher configuration.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Trait
impl Send for Trait
impl Sync for Trait
impl Unpin for Trait
impl UnwindSafe for Trait
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more