Struct sauron::prelude::mt_dom::Attribute [−]
pub struct Attribute<NS, ATT, VAL, EVENT> where
NS: PartialEq<NS> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug,
EVENT: PartialEq<EVENT> + Clone + Debug, { pub namespace: Option<NS>, pub name: ATT, pub value: Vec<AttValue<VAL, EVENT>, Global>, }
Expand description
These are the plain attributes of an element
Fields
namespace: Option<NS>
namespace of an attribute. This is specifically used by svg attributes such as xlink-href
name: ATT
the attribute name, optional since style attribute doesn’t need to have an attribute name
value: Vec<AttValue<VAL, EVENT>, Global>
the attribute value, which could be a simple value, and event or a function call
Implementations
create a plain attribute with namespace
pub fn with_multiple_values(
namespace: Option<NS>,
name: ATT,
value: Vec<VAL, Global>
) -> Attribute<NS, ATT, VAL, EVENT>
pub fn with_multiple_values(
namespace: Option<NS>,
name: ATT,
value: Vec<VAL, Global>
) -> Attribute<NS, ATT, VAL, EVENT>
create from multiple values
return the value of this attribute
Trait Implementations
impl<MSG> AttributeMapMsg<MSG> for Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG>> where
MSG: 'static,
impl<MSG> AttributeMapMsg<MSG> for Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG>> where
MSG: 'static,
map the msg
pub fn map_callback<MSG2>(
self,
cb: Callback<MSG, MSG2>
) -> Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG2>> where
MSG2: 'static,
pub fn map_callback<MSG2>(
self,
cb: Callback<MSG, MSG2>
) -> Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG2>> where
MSG2: 'static,
transform the callback of this attribute
render instance to a writable buffer with indention node_idx is for debugging purposes Read more
render the node to a writable buffer
no new_lines, no indents
render compressed html to string
Auto Trait Implementations
impl<NS, ATT, VAL, EVENT> RefUnwindSafe for Attribute<NS, ATT, VAL, EVENT> where
ATT: RefUnwindSafe,
EVENT: RefUnwindSafe,
NS: RefUnwindSafe,
VAL: RefUnwindSafe,
impl<NS, ATT, VAL, EVENT> Send for Attribute<NS, ATT, VAL, EVENT> where
ATT: Send,
EVENT: Send,
NS: Send,
VAL: Send,
impl<NS, ATT, VAL, EVENT> Sync for Attribute<NS, ATT, VAL, EVENT> where
ATT: Sync,
EVENT: Sync,
NS: Sync,
VAL: Sync,
impl<NS, ATT, VAL, EVENT> Unpin for Attribute<NS, ATT, VAL, EVENT> where
ATT: Unpin,
EVENT: Unpin,
NS: Unpin,
VAL: Unpin,
impl<NS, ATT, VAL, EVENT> UnwindSafe for Attribute<NS, ATT, VAL, EVENT> where
ATT: UnwindSafe,
EVENT: UnwindSafe,
NS: UnwindSafe,
VAL: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more