pub trait AsProperty {
    type Type<'a>
       where Self: 'a;

    // Required method
    fn as_property(&self) -> Self::Type<'_>;
}
Expand description

A type that can be used as a property.

This allows a type to be used as a property in custom_html_element. It exists so Strings can be passed as &str and copyable values, like bool can be passed by value.

Required Associated Types§

source

type Type<'a> where Self: 'a

Required Methods§

source

fn as_property(&self) -> Self::Type<'_>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AsProperty for bool

§

type Type<'a> = bool

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for f32

§

type Type<'a> = f32

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for f64

§

type Type<'a> = f64

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for i8

§

type Type<'a> = i8

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for i16

§

type Type<'a> = i16

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for i32

§

type Type<'a> = i32

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for i64

§

type Type<'a> = i64

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for u8

§

type Type<'a> = u8

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for u16

§

type Type<'a> = u16

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for u32

§

type Type<'a> = u32

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for u64

§

type Type<'a> = u64

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for usize

§

type Type<'a> = usize

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl AsProperty for String

§

type Type<'a> = &'a str

source§

fn as_property(&self) -> Self::Type<'_>

source§

impl<'a> AsProperty for &'a str

§

type Type<'b> = &'b str where 'a: 'b

source§

fn as_property(&self) -> Self::Type<'_>

Implementors§