IntoElement

Trait IntoElement 

Source
pub trait IntoElement: Sized {
    type Element: Element;

    // Required method
    fn into_element(self) -> Self::Element;

    // Provided method
    fn into_any_element(self) -> AnyElement { ... }
}
Expand description

Implemented by any type that can be converted into an element.

Required Associated Types§

Source

type Element: Element

The specific type of element into which the implementing type is converted. Useful for converting other types into elements automatically, like Strings

Required Methods§

Source

fn into_element(self) -> Self::Element

Convert self into a type that implements Element.

Provided Methods§

Source

fn into_any_element(self) -> AnyElement

Convert self into a dynamically-typed AnyElement.

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 IntoElement for &'static str

Source§

type Element = &'static str

Source§

fn into_element(self) -> Self::Element

Source§

impl IntoElement for String

Implementors§