pub trait AddAnyAttr {
type Output<SomeNewAttr: Attribute>: RenderHtml;
// Required method
fn add_any_attr<NewAttr>(self, attr: NewAttr) -> Self::Output<NewAttr>
where NewAttr: Attribute,
Self::Output<NewAttr>: RenderHtml;
}Expand description
Allows adding a new attribute to some type, before it is rendered. This takes place at compile time as part of the builder syntax for creating a statically typed view tree.
Normally, this is used to add an attribute to an HTML element. But it is required to be
implemented for all types that implement RenderHtml, so that attributes can be spread onto
other structures like the return type of a component.
Required Associated Types§
Sourcetype Output<SomeNewAttr: Attribute>: RenderHtml
type Output<SomeNewAttr: Attribute>: RenderHtml
The new type once the attribute has been added.
Required Methods§
Sourcefn add_any_attr<NewAttr>(self, attr: NewAttr) -> Self::Output<NewAttr>
fn add_any_attr<NewAttr>(self, attr: NewAttr) -> Self::Output<NewAttr>
Adds an attribute to the view.
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.