Enum freya::prelude::elements::AttributeValue
pub enum AttributeValue<'a> {
Text(&'a str),
Float(f64),
Int(i64),
Bool(bool),
Listener(RefCell<Option<Box<'a, dyn FnMut(Event<dyn Any + 'static>) + 'a>>>),
Any(RefCell<Option<Box<'a, dyn AnyValue + 'static>>>),
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<Box<'a, dyn FnMut(Event<dyn Any + 'static>) + 'a>>>)
A listener, like “onclick”
Any(RefCell<Option<Box<'a, dyn AnyValue + 'static>>>)
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§
§impl<'a> Debug for AttributeValue<'a>
impl<'a> Debug for AttributeValue<'a>
§impl<'a> IntoAttributeValue<'a> for AttributeValue<'a>
impl<'a> IntoAttributeValue<'a> for AttributeValue<'a>
§fn into_value(self, _: &'a Bump) -> AttributeValue<'a>
fn into_value(self, _: &'a Bump) -> AttributeValue<'a>
Convert into an attribute value
§impl<'a> PartialEq<AttributeValue<'a>> for AttributeValue<'a>
impl<'a> PartialEq<AttributeValue<'a>> for AttributeValue<'a>
§fn eq(&self, other: &AttributeValue<'a>) -> bool
fn eq(&self, other: &AttributeValue<'a>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AttributeValue<'a>
impl<'a> !Send for AttributeValue<'a>
impl<'a> !Sync for AttributeValue<'a>
impl<'a> Unpin for AttributeValue<'a>
impl<'a> !UnwindSafe for AttributeValue<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer