Trait SupportedParameterType

Source
pub trait SupportedParameterType:
    Sized
    + Clone
    + Send
    + Sync
    + 'static {
    const TYPE: ParameterType;

    // Required methods
    fn into_value(self) -> ParameterValue;
    fn from_value(value: ParameterValue) -> Result<Self>;
}
Expand description

This is a marker trait that is used to indicate that a type is a valid Hyperlight parameter type.

For each parameter type Hyperlight supports in host functions, we provide an implementation for SupportedParameterType

Required Associated Constants§

Source

const TYPE: ParameterType

The underlying Hyperlight parameter type representing this SupportedParameterType

Required Methods§

Source

fn into_value(self) -> ParameterValue

Get the underling Hyperlight parameter value representing this SupportedParameterType

Source

fn from_value(value: ParameterValue) -> Result<Self>

Get the actual inner value of this SupportedParameterType

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 SupportedParameterType for bool

Source§

const TYPE: ParameterType = ParameterType::Bool

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for f32

Source§

const TYPE: ParameterType = ParameterType::Float

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for f64

Source§

const TYPE: ParameterType = ParameterType::Double

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for i32

Source§

const TYPE: ParameterType = ParameterType::Int

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for i64

Source§

const TYPE: ParameterType = ParameterType::Long

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for u32

Source§

const TYPE: ParameterType = ParameterType::UInt

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for u64

Source§

const TYPE: ParameterType = ParameterType::ULong

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for String

Source§

const TYPE: ParameterType = ParameterType::String

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Source§

impl SupportedParameterType for Vec<u8>

Source§

const TYPE: ParameterType = ParameterType::VecBytes

Source§

fn into_value(self) -> ParameterValue

Source§

fn from_value(value: ParameterValue) -> Result<Self>

Implementors§