pub struct VariantMut<'a, T>{ /* private fields */ }
Expand description
Handle to a a variant inserted into a module which allows for mutation of its metadata.
Implementations§
Source§impl<T> VariantMut<'_, T>
impl<T> VariantMut<'_, T>
Sourcepub fn docs<I>(self, docs: I) -> Result<Self, ContextError>
pub fn docs<I>(self, docs: I) -> Result<Self, ContextError>
Set documentation for an inserted type.
This completely replaces any existing documentation.
Sourcepub fn static_docs(
self,
docs: &'static [&'static str],
) -> Result<Self, ContextError>
pub fn static_docs( self, docs: &'static [&'static str], ) -> Result<Self, ContextError>
Set static documentation.
This completely replaces any existing documentation.
Sourcepub fn make_named(
self,
fields: &'static [&'static str],
) -> Result<Self, ContextError>
pub fn make_named( self, fields: &'static [&'static str], ) -> Result<Self, ContextError>
Mark the given variant with named fields.
Sourcepub fn make_unnamed(self, fields: usize) -> Result<Self, ContextError>
pub fn make_unnamed(self, fields: usize) -> Result<Self, ContextError>
Mark the given variant with unnamed fields.
Sourcepub fn make_empty(self) -> Result<Self, ContextError>
pub fn make_empty(self) -> Result<Self, ContextError>
Mark the given variant as empty.
Sourcepub fn constructor<F, A>(self, constructor: F) -> Result<Self, ContextError>where
F: Function<A, Plain, Return = T>,
pub fn constructor<F, A>(self, constructor: F) -> Result<Self, ContextError>where
F: Function<A, Plain, Return = T>,
Register a constructor method for the current variant.
Auto Trait Implementations§
impl<'a, T> Freeze for VariantMut<'a, T>where
T: ?Sized,
impl<'a, T> !RefUnwindSafe for VariantMut<'a, T>
impl<'a, T> Send for VariantMut<'a, T>
impl<'a, T> Sync for VariantMut<'a, T>
impl<'a, T> Unpin for VariantMut<'a, T>
impl<'a, T> !UnwindSafe for VariantMut<'a, T>
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