pub enum Value {
    Generic(u64),
    I8(i8),
    U8(u8),
    I16(i16),
    U16(u16),
    I32(i32),
    U32(u32),
    I64(i64),
    U64(u64),
    F32(f32),
    F64(f64),
}
Expand description

The value of an entry on the DWARF stack.

Variants

Generic(u64)

A generic value, which is address-sized and of unspecified sign.

I8(i8)

A signed 8-bit integer value.

U8(u8)

An unsigned 8-bit integer value.

I16(i16)

A signed 16-bit integer value.

U16(u16)

An unsigned 16-bit integer value.

I32(i32)

A signed 32-bit integer value.

U32(u32)

An unsigned 32-bit integer value.

I64(i64)

A signed 64-bit integer value.

U64(u64)

An unsigned 64-bit integer value.

F32(f32)

A 32-bit floating point value.

F64(f64)

A 64-bit floating point value.

Implementations

Return the ValueType corresponding to this Value.

Read a Value with the given value_type from a Reader.

Convert a Value to a u64.

The ValueType of self must be integral. Values are sign extended if the source value is signed.

Create a Value with the given value_type from a u64 value.

The value_type may be integral or floating point. The result is truncated if the u64 value does not fit the bounds of the value_type.

Convert a Value to the given value_type.

When converting between integral types, the result is truncated if the source value does not fit the bounds of the value_type. When converting from floating point types, the result is not defined if the source value does not fit the bounds of the value_type.

This corresponds to the DWARF DW_OP_convert operation.

Reinterpret the bits in a Value as the given value_type.

The source and result value types must have equal sizes.

This corresponds to the DWARF DW_OP_reinterpret operation.

Perform an absolute value operation.

If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_abs operation.

Perform a negation operation.

If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_neg operation.

Perform an addition operation.

This operation requires matching types.

This corresponds to the DWARF DW_OP_plus operation.

Perform a subtraction operation.

This operation requires matching types.

This corresponds to the DWARF DW_OP_minus operation.

Perform a multiplication operation.

This operation requires matching types.

This corresponds to the DWARF DW_OP_mul operation.

Perform a division operation.

This operation requires matching types. If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_div operation.

Perform a remainder operation.

This operation requires matching integral types. If the value type is Generic, then it is interpreted as an unsigned value.

This corresponds to the DWARF DW_OP_mod operation.

Perform a bitwise not operation.

This operation requires matching integral types.

This corresponds to the DWARF DW_OP_not operation.

Perform a bitwise and operation.

This operation requires matching integral types.

This corresponds to the DWARF DW_OP_and operation.

Perform a bitwise or operation.

This operation requires matching integral types.

This corresponds to the DWARF DW_OP_or operation.

Perform a bitwise exclusive-or operation.

This operation requires matching integral types.

This corresponds to the DWARF DW_OP_xor operation.

Perform a shift left operation.

This operation requires integral types. If the shift length exceeds the type size, then 0 is returned. If the shift length is negative then an error is returned.

This corresponds to the DWARF DW_OP_shl operation.

Perform a logical shift right operation.

This operation requires an unsigned integral type for the value. If the value type is Generic, then it is interpreted as an unsigned value.

This operation requires an integral type for the shift length. If the shift length exceeds the type size, then 0 is returned. If the shift length is negative then an error is returned.

This corresponds to the DWARF DW_OP_shr operation.

Perform an arithmetic shift right operation.

This operation requires a signed integral type for the value. If the value type is Generic, then it is interpreted as a signed value.

This operation requires an integral type for the shift length. If the shift length exceeds the type size, then 0 is returned for positive values, and -1 is returned for negative values. If the shift length is negative then an error is returned.

This corresponds to the DWARF DW_OP_shra operation.

Perform the == relational operation.

This operation requires matching integral types. If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_eq operation.

Perform the >= relational operation.

This operation requires matching integral types. If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_ge operation.

Perform the > relational operation.

This operation requires matching integral types. If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_gt operation.

Perform the `<= relational operation.

This operation requires matching integral types. If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_le operation.

Perform the `< relational operation.

This operation requires matching integral types. If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_lt operation.

Perform the `!= relational operation.

This operation requires matching integral types. If the value type is Generic, then it is interpreted as a signed value.

This corresponds to the DWARF DW_OP_ne operation.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.