pub struct TypeMut<'a, T>{ /* private fields */ }
Expand description
Handle to a a type inserted into a module which allows for mutation of its metadata.
This is returned by the following methods:
Module::ty
- after a type has been inserted.Module::type_meta
- to modify type metadata for an already inserted type.
Implementations§
Source§impl<'a, T> TypeMut<'a, T>
impl<'a, T> TypeMut<'a, 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 deprecated<S>(self, deprecated: S) -> Result<Self, ContextError>
pub fn deprecated<S>(self, deprecated: S) -> Result<Self, ContextError>
Mark the given type as deprecated.
Sourcepub fn make_named_struct(
self,
fields: &'static [&'static str],
) -> Result<Self, ContextError>
pub fn make_named_struct( self, fields: &'static [&'static str], ) -> Result<Self, ContextError>
Mark the current type as a struct with named fields.
Sourcepub fn make_unnamed_struct(self, fields: usize) -> Result<Self, ContextError>
pub fn make_unnamed_struct(self, fields: usize) -> Result<Self, ContextError>
Mark the current type as a struct with unnamed fields.
Sourcepub fn make_empty_struct(self) -> Result<Self, ContextError>
pub fn make_empty_struct(self) -> Result<Self, ContextError>
Mark the current type as an empty struct.
Sourcepub fn make_enum(
self,
variants: &'static [&'static str],
) -> Result<EnumMut<'a, T>, ContextError>
pub fn make_enum( self, variants: &'static [&'static str], ) -> Result<EnumMut<'a, T>, ContextError>
Mark the current type as an enum.
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 type.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for TypeMut<'a, T>where
T: ?Sized,
impl<'a, T> !RefUnwindSafe for TypeMut<'a, T>
impl<'a, T> Send for TypeMut<'a, T>
impl<'a, T> Sync for TypeMut<'a, T>
impl<'a, T> Unpin for TypeMut<'a, T>
impl<'a, T> !UnwindSafe for TypeMut<'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