pub trait IntoComponent: Sized {
// Required method
fn as_component_ref(&self) -> ComponentRef<'_>;
// Provided method
fn into_component(self) -> Result<Component, Error> { ... }
}
Expand description
Trait for encoding the current type into a Component.
Required Methods§
Sourcefn as_component_ref(&self) -> ComponentRef<'_>
fn as_component_ref(&self) -> ComponentRef<'_>
Convert into a component directly.
Provided Methods§
Sourcefn into_component(self) -> Result<Component, Error>
fn into_component(self) -> Result<Component, Error>
Convert into component.
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 IntoComponent for &&str
impl IntoComponent for &&str
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component, Error>
Source§impl IntoComponent for &str
impl IntoComponent for &str
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component, Error>
Source§impl IntoComponent for Cow<'_, str>
impl IntoComponent for Cow<'_, str>
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component, Error>
Source§impl<T> IntoComponent for [T; 1]where
T: IntoComponent,
impl<T> IntoComponent for [T; 1]where
T: IntoComponent,
IntoCompoment implementation preserved for backwards compatibility.