pub enum AttributeValue<'a> {
    Text(&'a str),
    Float(f64),
    Int(i64),
    Bool(bool),
    Listener(RefCell<Option<BumpBox<'a, dyn FnMut(Event<dyn Any>) + 'a>>>),
    Any(RefCell<Option<BumpBox<'a, dyn AnyValue>>>),
    None,
}
Expand description

Any of the built-in values that the Dioxus VirtualDom supports as dynamic attributes on elements

These are built-in to be faster during the diffing process. To use a custom value, use the AttributeValue::Any variant.

Variants§

§

Text(&'a str)

Text attribute

§

Float(f64)

A float

§

Int(i64)

Signed integer

§

Bool(bool)

Boolean

§

Listener(RefCell<Option<BumpBox<'a, dyn FnMut(Event<dyn Any>) + 'a>>>)

A listener, like “onclick”

§

Any(RefCell<Option<BumpBox<'a, dyn AnyValue>>>)

An arbitrary value that implements PartialEq and is static

§

None

A “none” value, resulting in the removal of an attribute from the dom

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Convert into an attribute value
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.