pub trait ComponentType: RequireInvalidation + Sized {
// Required methods
fn into_component(self) -> Component;
fn try_from_component(component: Component) -> Result<Self, Component>;
}
Expand description
A type that can be converted to and from Component
.
Required Methods§
Sourcefn into_component(self) -> Component
fn into_component(self) -> Component
Returns this type, wrapped in a Component
.
Sourcefn try_from_component(component: Component) -> Result<Self, Component>
fn try_from_component(component: Component) -> Result<Self, Component>
Attempts to extract this type from component
. If component
does not
contain this type, Err(component)
is returned.
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.