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>
Available on crate feature alloc only.
fn into_component(self) -> Result<Component, Error>
alloc only.Convert into component.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl IntoComponent for &&str
impl IntoComponent for &&str
fn as_component_ref(&self) -> ComponentRef<'_>
Source§impl IntoComponent for &str
impl IntoComponent for &str
fn as_component_ref(&self) -> ComponentRef<'_>
Source§impl IntoComponent for Cow<'_, str>
impl IntoComponent for Cow<'_, str>
fn as_component_ref(&self) -> ComponentRef<'_>
Source§impl<T> IntoComponent for [T; 1]where
T: IntoComponent,
IntoCompoment implementation preserved for backwards compatibility.
impl<T> IntoComponent for [T; 1]where
T: IntoComponent,
IntoCompoment implementation preserved for backwards compatibility.
fn as_component_ref(&self) -> ComponentRef<'_>
Implementors§
impl IntoComponent for &Box<str>
impl IntoComponent for &Component
Available on crate feature
alloc only.impl IntoComponent for &ComponentRef<'_>
impl IntoComponent for &String
impl IntoComponent for Box<str>
impl IntoComponent for Component
Available on crate feature
alloc only.