pub struct TemplateContext { /* private fields */ }Implementations§
Source§impl TemplateContext
impl TemplateContext
Sourcepub fn enter_template(&mut self, params: Vec<String>)
pub fn enter_template(&mut self, params: Vec<String>)
Enter a template scope with the given type parameters
§Example
use rusty_cpp::parser::TemplateContext;
let mut ctx = TemplateContext::new();
ctx.enter_template(vec!["T".to_string(), "U".to_string()]);
assert!(ctx.is_type_parameter("T"));Sourcepub fn exit_template(&mut self)
pub fn exit_template(&mut self)
Exit the current template scope, clearing all type parameters
Sourcepub fn is_type_parameter(&self, name: &str) -> bool
pub fn is_type_parameter(&self, name: &str) -> bool
Sourcepub fn get_type_parameters(&self) -> &HashSet<String>
pub fn get_type_parameters(&self) -> &HashSet<String>
Get all type parameters in current scope
Sourcepub fn is_in_template(&self) -> bool
pub fn is_in_template(&self) -> bool
Check if we’re currently in a template scope
Trait Implementations§
Source§impl Clone for TemplateContext
impl Clone for TemplateContext
Source§fn clone(&self) -> TemplateContext
fn clone(&self) -> TemplateContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TemplateContext
impl Debug for TemplateContext
Source§impl Default for TemplateContext
impl Default for TemplateContext
Source§fn default() -> TemplateContext
fn default() -> TemplateContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TemplateContext
impl RefUnwindSafe for TemplateContext
impl Send for TemplateContext
impl Sync for TemplateContext
impl Unpin for TemplateContext
impl UnwindSafe for TemplateContext
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