[−][src]Struct c2rust_transpile::renamer::Renamer
Methods
impl<T: Clone + Eq + Hash> Renamer<T>
[src]
pub fn new(reserved_names: &[&str]) -> Self
[src]
Creates a new renaming environment with a single, empty scope. The given set of reserved names will exclude those names from being chosen as the mangled names from the insert method.
pub fn add_scope(&mut self)
[src]
Introduces a new name binding scope
pub fn drop_scope(&mut self)
[src]
Drops the current name binding scope
pub fn pick_name(&mut self, basename: &str) -> String
[src]
pub fn pick_name_root(&mut self, basename: &str) -> String
[src]
Permanently assign a name that doesn't collide with anything currently in scope, and also never goes out of scope
pub fn insert(&mut self, key: T, basename: &str) -> Option<String>
[src]
Introduce a new name binding into the current scope. If the key is unbound in the current scope then Some of the resulting mangled name is returned, otherwise None.
pub fn insert_root(&mut self, key: T, basename: &str) -> Option<String>
[src]
Introduce a new name binding into the root scope. If the key is unbound in the root scope then Some of the resulting mangled name is returned, otherwise None.
pub fn alias(&mut self, new_key: T, old_key: &T)
[src]
Assign a name in the current scope without reservation or checking for overlap. This is intended to be used when one key is going to be merged
pub fn get(&self, key: &T) -> Option<String>
[src]
Lookup the given key in all of the scopes returning Some of the matched mangled name if one exists, otherwise None.
pub fn fresh(&mut self) -> String
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> Erased for T
[src]
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Make for T
[src]
impl<T> MaybeResult for T
[src]
impl<'a, T> Captures for T where
T: ?Sized,
[src]
T: ?Sized,