Skip to main content

IntoComponent

Trait IntoComponent 

Source
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§

Source

fn as_component_ref(&self) -> ComponentRef<'_>

Convert into a component directly.

Provided Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl IntoComponent for &&str

Source§

impl IntoComponent for &Box<str>

Source§

impl IntoComponent for &String

Source§

impl IntoComponent for &str

Source§

impl IntoComponent for Box<str>

Source§

impl IntoComponent for Cow<'_, str>

Source§

impl IntoComponent for Cow<'_, str>

Source§

impl IntoComponent for String

Source§

impl<T> IntoComponent for [T; 1]
where T: IntoComponent,

IntoCompoment implementation preserved for backwards compatibility.

Implementors§

Source§

impl IntoComponent for &Component

Available on crate feature alloc only.
Source§

impl IntoComponent for &ComponentRef<'_>

Source§

impl IntoComponent for Component

Available on crate feature alloc only.
Source§

impl IntoComponent for ComponentRef<'_>