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.

Implementations on Foreign Types§

source§

impl ComponentType for u8

source§

impl ComponentType for i64

source§

impl ComponentType for String

source§

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

source§

impl ComponentType for i8

source§

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

source§

impl ComponentType for char

source§

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

source§

impl ComponentType for u32

source§

impl ComponentType for Box<str>

source§

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

source§

impl ComponentType for Arc<str>

source§

impl ComponentType for bool

source§

impl ComponentType for i16

source§

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

source§

impl ComponentType for u64

source§

impl ComponentType for f64

source§

impl ComponentType for i32

source§

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

source§

impl ComponentType for u16

source§

impl ComponentType for f32

Implementors§