Struct rune::module::VariantMut
source · 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>
pub fn constructor<F, A>(self, constructor: F) -> Result<Self, ContextError>
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