pub struct Context<'a, 'types> { /* private fields */ }Expand description
Context for the rendering process.
This contains different additional information and configuration that may be
needed by a Renderer to render the actual code. It is
also used to collect the rendered code and add it to the corresponding module.
Implementations§
Source§impl<'a, 'types> Context<'a, 'types>
impl<'a, 'types> Context<'a, 'types>
Sourcepub fn current_ns(&self) -> Option<NamespaceId>
pub fn current_ns(&self) -> Option<NamespaceId>
Returns the namespace ID of the currently rendered type.
Sourcepub fn resolve_type_for_module(&self, ident: &IdentPath) -> TokenStream
pub fn resolve_type_for_module(&self, ident: &IdentPath) -> TokenStream
Resolves the passed ident relative to the module of the current rendered type.
Sourcepub fn add_usings<I>(&self, usings: I)
pub fn add_usings<I>(&self, usings: I)
Add using directives to the module the of the current rendered type.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'types> !Freeze for Context<'a, 'types>
impl<'a, 'types> !RefUnwindSafe for Context<'a, 'types>
impl<'a, 'types> !Send for Context<'a, 'types>
impl<'a, 'types> !Sync for Context<'a, 'types>
impl<'a, 'types> Unpin for Context<'a, 'types>
impl<'a, 'types> !UnwindSafe for Context<'a, 'types>
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