pub struct Value(/* private fields */);Expand description
An SSA value in a function: a block parameter or an instruction result.
Every value has one type and exactly one definition. It prints as v<n>.
§Examples
use ir_lang::Value;
let h = Value::from_u32(3);
assert_eq!(h.index(), 3);
assert_eq!(h.to_string(), "v3");Implementations§
Source§impl Value
impl Value
Sourcepub const fn from_u32(index: u32) -> Self
pub const fn from_u32(index: u32) -> Self
Makes a handle from a raw index.
Handles normally come from the module or function that owns the entity. This constructor exists for side tables and tests; a handle made up this way is checked like any other (an out-of-range handle is a validation error, never a panic).
§Examples
use ir_lang::Value;
assert_eq!(Value::from_u32(0).index(), 0);Trait Implementations§
impl Copy for Value
impl Eq for Value
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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