Trait wasm_component_layer::ComponentType

source ·
pub trait ComponentType: 'static + Sized {
    // Required methods
    fn ty() -> ValueType;
    fn from_value(value: &Value) -> Result<Self>;
    fn into_value(self) -> Result<Value>;
}
Expand description

A type which can convert itself to and from component model values.

Required Methods§

source

fn ty() -> ValueType

Gets the component model type for instances of Self.

source

fn from_value(value: &Value) -> Result<Self>

Attempts to create an instance of Self from a component model value.

source

fn into_value(self) -> Result<Value>

Attempts to convert Self into a component model value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ComponentType for bool

source§

impl ComponentType for char

source§

impl ComponentType for f32

source§

impl ComponentType for f64

source§

impl ComponentType for i8

source§

impl ComponentType for i16

source§

impl ComponentType for i32

source§

impl ComponentType for i64

source§

impl ComponentType for u8

source§

impl ComponentType for u16

source§

impl ComponentType for u32

source§

impl ComponentType for u64

source§

impl ComponentType for Box<str>

source§

impl ComponentType for String

source§

impl ComponentType for Arc<str>

source§

impl ComponentType for Result<(), ()>

source§

impl<A: ComponentType> ComponentType for (A,)

source§

impl<A: ComponentType, B: ComponentType> ComponentType for (A, B)

source§

impl<A: ComponentType, B: ComponentType, C: ComponentType> ComponentType for (A, B, C)

source§

impl<A: ComponentType, B: ComponentType, C: ComponentType, D: ComponentType> ComponentType for (A, B, C, D)

source§

impl<A: ComponentType, B: ComponentType, C: ComponentType, D: ComponentType, E: ComponentType> ComponentType for (A, B, C, D, E)

source§

impl<A: ComponentType, B: ComponentType, C: ComponentType, D: ComponentType, E: ComponentType, F: ComponentType> ComponentType for (A, B, C, D, E, F)

source§

impl<A: ComponentType, B: ComponentType, C: ComponentType, D: ComponentType, E: ComponentType, F: ComponentType, G: ComponentType> ComponentType for (A, B, C, D, E, F, G)

source§

impl<A: ComponentType, B: ComponentType, C: ComponentType, D: ComponentType, E: ComponentType, F: ComponentType, G: ComponentType, H: ComponentType> ComponentType for (A, B, C, D, E, F, G, H)

source§

impl<T: ComponentType> ComponentType for Option<T>

source§

impl<T: ComponentType> ComponentType for Box<T>

source§

impl<T: ComponentType> ComponentType for Vec<T>

source§

impl<T: ComponentType> ComponentType for Result<(), T>

source§

impl<T: ComponentType> ComponentType for Result<T, ()>

source§

impl<U: ComponentType, V: ComponentType> ComponentType for Result<U, V>

Implementors§