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§
Source§impl VariableName
impl VariableName
Sourcepub fn from_string<N: ToString>(name: N) -> VariableName
pub fn from_string<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§
Source§impl Clone for VariableName
impl Clone for VariableName
Source§fn clone(&self) -> VariableName
fn clone(&self) -> VariableName
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 VariableName
Debug for VariableName outputs the full name (including suffix and version).
impl Debug for VariableName
Debug for VariableName outputs the full name (including suffix and version).
Source§impl Display for VariableName
Display for VariableName only outputs the original name.
impl Display for VariableName
Display for VariableName only outputs the original name.
Source§impl Hash for VariableName
impl Hash for VariableName
Source§impl PartialEq for VariableName
impl PartialEq for VariableName
impl Eq for VariableName
impl StructuralPartialEq for VariableName
Auto Trait Implementations§
impl Freeze for VariableName
impl RefUnwindSafe for VariableName
impl Send for VariableName
impl Sync for VariableName
impl Unpin for VariableName
impl UnwindSafe for VariableName
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