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§
Sourcefn from_value(value: &Value) -> Result<Self>
fn from_value(value: &Value) -> Result<Self>
Attempts to create an instance of Self from a component model value.
Sourcefn into_value(self) -> Result<Value>
fn into_value(self) -> Result<Value>
Attempts to convert Self into a component model value.
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.