Skip to main content

ValueRef

Enum ValueRef 

Source
pub enum ValueRef<'str, 'ctx, R = ModuleView<'ctx, 'str>> {
    Literal(LiteralRef<'str, 'ctx>),
    Bytes(BytesRef<'str, 'ctx>),
    Instruction(InstructionRef<'str, 'ctx, R>),
    BasicBlock(BlockRef<'str, 'ctx, R>),
    BlockParam(BlockParamRef<'str, 'ctx, R>),
    Varnode(VarnodeRef<'str, 'ctx>),
    Temp(TempRef<'str, 'ctx, R>),
    Function(FunctionRef<'str, 'ctx, R>),
    Poison(PoisonRef<'str, 'ctx>),
}
Expand description

A borrowed, type-erased view of any value in a Context.

ValueRef is the runtime-typed counterpart to ValueId. It is produced by Context::get_value and borrows the context for 'ctx. Use pattern matching to downcast to a concrete reference type.

Variants§

§

Literal(LiteralRef<'str, 'ctx>)

§

Bytes(BytesRef<'str, 'ctx>)

§

Instruction(InstructionRef<'str, 'ctx, R>)

§

BasicBlock(BlockRef<'str, 'ctx, R>)

§

BlockParam(BlockParamRef<'str, 'ctx, R>)

§

Varnode(VarnodeRef<'str, 'ctx>)

§

Temp(TempRef<'str, 'ctx, R>)

§

Function(FunctionRef<'str, 'ctx, R>)

§

Poison(PoisonRef<'str, 'ctx>)

Implementations§

Source§

impl<'str, 'ctx> ValueRef<'str, 'ctx>

Source

pub fn new(id: ValueId, ctx: &'ctx Context<'str>) -> Self

Source

pub fn from_id(ctx: &'ctx Context<'str>, id: ValueId) -> Self

Source§

impl<'str: 'ctx, 'ctx, R> ValueRef<'str, 'ctx, R>
where R: QCodeView<'ctx, 'str>,

Source

pub fn from_view(view: R, id: ValueId) -> Self

Source

pub fn space(&self) -> Option<SpaceRef<'ctx>>

Source

pub fn memory_space(&self) -> Option<MemorySpaceId>

Qualified memory-space provenance. Unlike space, this represents body-local temporary spaces without pretending they are shared Space values.

Trait Implementations§

Source§

impl<R> Debug for ValueRef<'_, '_, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'str: 'ctx, 'ctx, R> Display for ValueRef<'str, 'ctx, R>
where R: QCodeView<'ctx, 'str>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'str, 'ctx, R> From<BaseRef<&'ctx Shared<'str>, BytesId>> for ValueRef<'str, 'ctx, R>

Source§

fn from(bytes_ref: BytesRef<'str, 'ctx>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<BaseRef<&'ctx Shared<'str>, LiteralId>> for ValueRef<'str, 'ctx, R>

Source§

fn from(lit_ref: LiteralRef<'str, 'ctx>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<BaseRef<&'ctx Shared<'str>, PoisonId>> for ValueRef<'str, 'ctx, R>

Source§

fn from(poison_ref: PoisonRef<'str, 'ctx>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<BaseRef<&'ctx Shared<'str>, VarnodeId>> for ValueRef<'str, 'ctx, R>

Source§

fn from(var_ref: VarnodeRef<'str, 'ctx>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<BlockParamRef<'str, 'ctx, R>> for ValueRef<'str, 'ctx, R>

Source§

fn from(param_ref: BlockParamRef<'str, 'ctx, R>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<BlockRef<'str, 'ctx, R>> for ValueRef<'str, 'ctx, R>

Source§

fn from(bb_ref: BlockRef<'str, 'ctx, R>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<FunctionRef<'str, 'ctx, R>> for ValueRef<'str, 'ctx, R>

Source§

fn from(fn_ref: FunctionRef<'str, 'ctx, R>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<InstructionRef<'str, 'ctx, R>> for ValueRef<'str, 'ctx, R>

Source§

fn from(insn_ref: InstructionRef<'str, 'ctx, R>) -> Self

Converts to this type from the input type.
Source§

impl<'str, 'ctx, R> From<TempRef<'str, 'ctx, R>> for ValueRef<'str, 'ctx, R>

Source§

fn from(temp_ref: TempRef<'str, 'ctx, R>) -> Self

Converts to this type from the input type.
Source§

impl<'str: 'ctx, 'ctx, R> Value<'str, 'ctx> for ValueRef<'str, 'ctx, R>
where R: QCodeView<'ctx, 'str>,

Source§

fn id(&self) -> ValueId

The context-unique identifier for this value.
Source§

fn size(&self) -> usize

The size of this value’s output in bytes, or 0 for non-data values (terminators, blocks, functions).

Auto Trait Implementations§

§

impl<'str, 'ctx, R> Freeze for ValueRef<'str, 'ctx, R>
where InstructionRef<'str, 'ctx, R>: Freeze, BlockRef<'str, 'ctx, R>: Freeze, BlockParamRef<'str, 'ctx, R>: Freeze, TempRef<'str, 'ctx, R>: Freeze, FunctionRef<'str, 'ctx, R>: Freeze,

§

impl<'str, 'ctx, R> RefUnwindSafe for ValueRef<'str, 'ctx, R>
where InstructionRef<'str, 'ctx, R>: RefUnwindSafe, BlockRef<'str, 'ctx, R>: RefUnwindSafe, BlockParamRef<'str, 'ctx, R>: RefUnwindSafe, TempRef<'str, 'ctx, R>: RefUnwindSafe, FunctionRef<'str, 'ctx, R>: RefUnwindSafe,

§

impl<'str, 'ctx, R> Send for ValueRef<'str, 'ctx, R>
where InstructionRef<'str, 'ctx, R>: Send, BlockRef<'str, 'ctx, R>: Send, BlockParamRef<'str, 'ctx, R>: Send, TempRef<'str, 'ctx, R>: Send, FunctionRef<'str, 'ctx, R>: Send,

§

impl<'str, 'ctx, R> Sync for ValueRef<'str, 'ctx, R>
where InstructionRef<'str, 'ctx, R>: Sync, BlockRef<'str, 'ctx, R>: Sync, BlockParamRef<'str, 'ctx, R>: Sync, TempRef<'str, 'ctx, R>: Sync, FunctionRef<'str, 'ctx, R>: Sync,

§

impl<'str, 'ctx, R> Unpin for ValueRef<'str, 'ctx, R>
where InstructionRef<'str, 'ctx, R>: Unpin, BlockRef<'str, 'ctx, R>: Unpin, BlockParamRef<'str, 'ctx, R>: Unpin, TempRef<'str, 'ctx, R>: Unpin, FunctionRef<'str, 'ctx, R>: Unpin,

§

impl<'str, 'ctx, R> UnsafeUnpin for ValueRef<'str, 'ctx, R>
where InstructionRef<'str, 'ctx, R>: UnsafeUnpin, BlockRef<'str, 'ctx, R>: UnsafeUnpin, BlockParamRef<'str, 'ctx, R>: UnsafeUnpin, TempRef<'str, 'ctx, R>: UnsafeUnpin, FunctionRef<'str, 'ctx, R>: UnsafeUnpin,

§

impl<'str, 'ctx, R> UnwindSafe for ValueRef<'str, 'ctx, R>
where InstructionRef<'str, 'ctx, R>: UnwindSafe, BlockRef<'str, 'ctx, R>: UnwindSafe, BlockParamRef<'str, 'ctx, R>: UnwindSafe, TempRef<'str, 'ctx, R>: UnwindSafe, FunctionRef<'str, 'ctx, R>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.