pub struct TraitMut<'a> { /* private fields */ }
Expand description
Handle to a a trait inserted into a module which allows for mutation of its metadata.
Implementations§
Source§impl TraitMut<'_>
impl TraitMut<'_>
Sourcepub fn docs<I>(&mut self, docs: I) -> Result<&mut Self, ContextError>
pub fn docs<I>(&mut self, docs: I) -> Result<&mut Self, ContextError>
Set documentation for an inserted trait.
This completely replaces any existing documentation.
Sourcepub fn static_docs(
&mut self,
docs: &'static [&'static str],
) -> Result<&mut Self, ContextError>
pub fn static_docs( &mut self, docs: &'static [&'static str], ) -> Result<&mut Self, ContextError>
Set static documentation.
This completely replaces any existing documentation.
Sourcepub fn deprecated<S>(
&mut self,
deprecated: S,
) -> Result<&mut Self, ContextError>
pub fn deprecated<S>( &mut self, deprecated: S, ) -> Result<&mut Self, ContextError>
Mark the given trait as deprecated.
Sourcepub fn handler<F>(&mut self, handler: F) -> Result<&mut Self, ContextError>
pub fn handler<F>(&mut self, handler: F) -> Result<&mut Self, ContextError>
Define a trait handler.
Sourcepub fn function(
&mut self,
name: impl ToInstance,
) -> Result<ItemFnMut<'_>, ContextError>
pub fn function( &mut self, name: impl ToInstance, ) -> Result<ItemFnMut<'_>, ContextError>
Define a function on the trait.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TraitMut<'a>
impl<'a> !RefUnwindSafe for TraitMut<'a>
impl<'a> Send for TraitMut<'a>
impl<'a> Sync for TraitMut<'a>
impl<'a> Unpin for TraitMut<'a>
impl<'a> !UnwindSafe for TraitMut<'a>
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