pub struct VariableName { /* private fields */ }Expand description
A IR variable name consists of three components.
- The original name (obtained from the source code).
- An optional suffix (used to ensure uniqueness when lifting to IR).
- An optional version (applied when the CFG is converted to SSA form).
Implementations
sourceimpl VariableName
impl VariableName
sourcepub fn from_name<N: ToString>(name: N) -> VariableName
pub fn from_name<N: ToString>(name: N) -> VariableName
Returns a new variable name with the given name (without suffix or version).
pub fn name(&self) -> &String
pub fn suffix(&self) -> &Option<String>
pub fn version(&self) -> &Option<usize>
sourcepub fn with_suffix<S: ToString>(&self, suffix: S) -> VariableName
pub fn with_suffix<S: ToString>(&self, suffix: S) -> VariableName
Returns a new copy of the variable name, adding the given suffix.
sourcepub fn with_version(&self, version: usize) -> VariableName
pub fn with_version(&self, version: usize) -> VariableName
Returns a new copy of the variable name, adding the given version.
sourcepub fn without_suffix(&self) -> VariableName
pub fn without_suffix(&self) -> VariableName
Returns a new copy of the variable name with the suffix dropped.
sourcepub fn without_version(&self) -> VariableName
pub fn without_version(&self) -> VariableName
Returns a new copy of the variable name with the version dropped.
Trait Implementations
sourceimpl Clone for VariableName
impl Clone for VariableName
sourcefn clone(&self) -> VariableName
fn clone(&self) -> VariableName
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for VariableName
impl Debug for VariableName
Debug for VariableName outputs the full name (including suffix and version).
sourceimpl Display for VariableName
impl Display for VariableName
Display for VariableName only outputs the original name.
sourceimpl Hash for VariableName
impl Hash for VariableName
sourceimpl PartialEq<VariableName> for VariableName
impl PartialEq<VariableName> for VariableName
sourcefn eq(&self, other: &VariableName) -> bool
fn eq(&self, other: &VariableName) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Eq for VariableName
impl StructuralEq for VariableName
impl StructuralPartialEq for VariableName
Auto Trait Implementations
impl RefUnwindSafe for VariableName
impl Send for VariableName
impl Sync for VariableName
impl Unpin for VariableName
impl UnwindSafe for VariableName
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more