Trait DebugValue

Source
pub trait DebugValue: Sized {
    const VALUE_TYPE: u32;

    // Required method
    fn from_debug_value(val: &DEBUG_VALUE) -> Self;
}
Expand description

A trait to extract a value from a [DEBUG_VALUE].

Required Associated Constants§

Source

const VALUE_TYPE: u32

The corresponding DEBUG_VALUE_TYPE for this type.

Required Methods§

Source

fn from_debug_value(val: &DEBUG_VALUE) -> Self

Extracts the value from a DEBUG_VALUE

§Arguments
  • val - A reference to the DEBUG_VALUE to be converted.
§Returns
  • Self - If the conversion is successful.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl DebugValue for f32

Source§

const VALUE_TYPE: u32 = 5u32

Specifies that the value should be interpreted as a 32-bit floating-point number.

Source§

fn from_debug_value(val: &DEBUG_VALUE) -> Self

Extracts a 32-bit floating-point value f32 from a DEBUG_VALUE.

Source§

impl DebugValue for f64

Source§

const VALUE_TYPE: u32 = 6u32

Specifies that the value should be interpreted as a 64-bit floating-point number.

Source§

fn from_debug_value(val: &DEBUG_VALUE) -> Self

Extracts a 64-bit floating-point value f64 from a DEBUG_VALUE.

Source§

impl DebugValue for u32

Source§

const VALUE_TYPE: u32 = 3u32

Specifies that the value should be interpreted as a 32-bit integer.

Source§

fn from_debug_value(val: &DEBUG_VALUE) -> Self

Extracts a 32-bit integer (u32 from a DEBUG_VALUE.

Source§

impl DebugValue for u64

Source§

const VALUE_TYPE: u32 = 4u32

Specifies that the value should be interpreted as a 64-bit integer.

Source§

fn from_debug_value(val: &DEBUG_VALUE) -> Self

Extracts a 64-bit integer u64 from a DEBUG_VALUE.

Implementors§