#[non_exhaustive]pub struct Context<'ctx> {
pub ident_generator: &'ctx mut dyn IdentGenerator,
/* private fields */
}
Expand description
The context passed to each generation stage of Generatable
types
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.ident_generator: &'ctx mut dyn IdentGenerator
The ident generator used to generate unique idents across all templates.
Implementations§
Source§impl<'ctx> Context<'ctx>
impl<'ctx> Context<'ctx>
pub fn new(ident_generator: &mut dyn IdentGenerator) -> Context<'_>
pub fn set_require_nonconstant_code(&mut self)
pub const fn requires_nonconstant_code(&self) -> bool
Auto Trait Implementations§
impl<'ctx> Freeze for Context<'ctx>
impl<'ctx> !RefUnwindSafe for Context<'ctx>
impl<'ctx> !Send for Context<'ctx>
impl<'ctx> !Sync for Context<'ctx>
impl<'ctx> Unpin for Context<'ctx>
impl<'ctx> !UnwindSafe for Context<'ctx>
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T
behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T
behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Rc
pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Arc
pointerSource§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