Struct proc_macro_assertions::context::Context
source · #[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> !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 Twhere
T: Any + ?Sized,
impl<T> AnyExt for Twhere T: Any + ?Sized,
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