pub trait IntoComponent: Sized {
// Required method
fn as_component_ref(&self) -> ComponentRef<'_>;
// Provided method
fn into_component(self) -> Result<Component> { ... }
}
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>
fn into_component(self) -> Result<Component>
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>
Source§impl IntoComponent for &str
impl IntoComponent for &str
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component>
Source§impl IntoComponent for &Box<str>
impl IntoComponent for &Box<str>
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component>
Source§impl IntoComponent for &String
impl IntoComponent for &String
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component>
Source§impl IntoComponent for Cow<'_, str>
impl IntoComponent for Cow<'_, str>
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component>
Source§impl IntoComponent for Cow<'_, str>
impl IntoComponent for Cow<'_, str>
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component>
Source§impl IntoComponent for Box<str>
impl IntoComponent for Box<str>
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component>
Source§impl IntoComponent for String
impl IntoComponent for String
fn as_component_ref(&self) -> ComponentRef<'_>
fn into_component(self) -> Result<Component>
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.