Trait silkenweb::attribute::Attribute

source ·
pub trait Attribute {
    type Text<'a>: 'a + AsRef<str> + Into<String> + ToString
       where Self: 'a;

    // Required method
    fn text(&self) -> Option<Self::Text<'_>>;
}
Expand description

A type that can be used as the value of an attribute.

See module-level documentation for more details.

Required Associated Types§

source

type Text<'a>: 'a + AsRef<str> + Into<String> + ToString where Self: 'a

Required Methods§

source

fn text(&self) -> Option<Self::Text<'_>>

The attribute value text.

Return Some(text) to set the attribute, or None to unset the attribute. For example, bool attributes set the attribute if true, or unset the attribute if false.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Attribute for bool

§

type Text<'a> = &'static str

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for f32

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for f64

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for i8

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for i16

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for i32

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for i64

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for u8

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for u16

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for u32

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for u64

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for usize

§

type Text<'a> = String

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl Attribute for String

§

type Text<'a> = &'a str

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl<'a> Attribute for &'a str

§

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

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl<'a> Attribute for &'a String

§

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

source§

fn text(&self) -> Option<Self::Text<'_>>

source§

impl<T: Attribute> Attribute for Option<T>

§

type Text<'a> = <T as Attribute>::Text<'a> where T: 'a

source§

fn text(&self) -> Option<Self::Text<'_>>

Implementors§

source§

impl Attribute for Length

§

type Text<'a> = String

source§

impl Attribute for Auto

§

type Text<'a> = &'static str

source§

impl Attribute for Percentage

§

type Text<'a> = String

source§

impl Attribute for Data

§

type Text<'a> = &'a str