pub struct Attribute {
pub name: &'static str,
pub value: AttributeValue,
pub namespace: Option<&'static str>,
pub volatile: bool,
}Expand description
An attribute on a DOM node, such as id="my-thing" or href="https://example.com"
Fields§
§name: &'static strThe name of the attribute.
value: AttributeValueThe value of the attribute
namespace: Option<&'static str>The namespace of the attribute.
Doesn’t exist in the html spec. Used in Dioxus to denote “style” tags and other attribute groups.
volatile: boolAn indication of we should always try and set the attribute. Used in controlled components to ensure changes are propagated
Implementations§
Source§impl Attribute
impl Attribute
Sourcepub fn new<T>(
name: &'static str,
value: impl IntoAttributeValue<T>,
namespace: Option<&'static str>,
volatile: bool,
) -> Attribute
pub fn new<T>( name: &'static str, value: impl IntoAttributeValue<T>, namespace: Option<&'static str>, volatile: bool, ) -> Attribute
Create a new Attribute from a name, value, namespace, and volatile bool
“Volatile” refers to whether or not Dioxus should always override the value. This helps prevent the UI in some renderers stay in sync with the VirtualDom’s understanding of the world
Trait Implementations§
Source§impl Extend<Attribute> for Spread
impl Extend<Attribute> for Spread
Source§fn extend<I: IntoIterator<Item = Attribute>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Attribute>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Attribute> for Spread
impl FromIterator<Attribute> for Spread
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl !RefUnwindSafe for Attribute
impl !Send for Attribute
impl !Sync for Attribute
impl !UnwindSafe for Attribute
impl Freeze for Attribute
impl Unpin for Attribute
impl UnsafeUnpin for Attribute
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.