Module silkenweb::attribute

source ·
Expand description

Traits for defining attribute types.

Attribute defines how an attribute is rendered and AsAttribute is a marker trait to say where the attribute can be used.

For example, both String and &str can be used as String attributes because &str implements AsAttribute<String>.

Once you’ve implemented Attribute and AsAttribute for your type, you can use it with Element::attribute, or define attributes on your own html element using the custom_html_element macro.

Traits§

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