[][src]Struct c2rust_transpile::renamer::Renamer

pub struct Renamer<T> { /* fields omitted */ }

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

impl<T> Send for Renamer<T> where
    T: Send

impl<T> Sync for Renamer<T> where
    T: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Make for T[src]

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T