IntoComponent

Trait IntoComponent 

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

Source

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

Convert into a component directly.

Provided Methods§

Source

fn into_component(self) -> Result<Component, Error>

Available on crate feature alloc only.

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

Source§

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

Source§

fn into_component(self) -> Result<Component, Error>

Available on crate feature alloc only.
Source§

impl IntoComponent for &str

Source§

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

Source§

fn into_component(self) -> Result<Component, Error>

Available on crate feature alloc only.
Source§

impl IntoComponent for Cow<'_, str>

Source§

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

Source§

fn into_component(self) -> Result<Component, Error>

Available on crate feature alloc only.
Source§

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

IntoCompoment implementation preserved for backwards compatibility.

Source§

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

Source§

fn into_component(self) -> Result<Component, Error>

Available on crate feature alloc only.

Implementors§

Source§

impl IntoComponent for &Component

Available on crate feature alloc only.
Source§

impl IntoComponent for &ComponentRef<'_>

Source§

impl IntoComponent for &Box<str>

Source§

impl IntoComponent for &String

Source§

impl IntoComponent for rune::alloc::borrow::Cow<'_, str>

Source§

impl IntoComponent for Component

Available on crate feature alloc only.
Source§

impl IntoComponent for ComponentRef<'_>

Source§

impl IntoComponent for Box<str>

Source§

impl IntoComponent for String