Struct sauron::prelude::mt_dom::Attribute [−]
pub struct Attribute<NS, ATT, VAL> where
NS: PartialEq<NS> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug, {
pub namespace: Option<NS>,
pub name: ATT,
pub value: Vec<VAL, 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<VAL, 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: impl IntoIterator<Item = VAL>
) -> Attribute<NS, ATT, VAL>
pub fn with_multiple_values(
namespace: Option<NS>,
name: ATT,
value: impl IntoIterator<Item = VAL>
) -> Attribute<NS, ATT, VAL>
create from multiple values
return the value of this attribute
Trait Implementations
impl<MSG> AttributeMapMsg<MSG> for Attribute<&'static str, &'static str, AttributeValue<MSG>> where
MSG: 'static,
impl<MSG> AttributeMapMsg<MSG> for Attribute<&'static str, &'static str, AttributeValue<MSG>> where
MSG: 'static,
map the msg
pub fn map_callback<MSG2>(
self,
cb: Listener<MSG, MSG2>
) -> Attribute<&'static str, &'static str, AttributeValue<MSG2>> where
MSG2: 'static,
pub fn map_callback<MSG2>(
self,
cb: Listener<MSG, MSG2>
) -> Attribute<&'static str, &'static str, AttributeValue<MSG2>> where
MSG2: 'static,
transform the callback of this attribute
render instance to a writable buffer with indention
render the node to a writable buffer
no new_lines, no indents
render compressed html to string
render to string with nice indention
Auto Trait Implementations
impl<NS, ATT, VAL> RefUnwindSafe for Attribute<NS, ATT, VAL> where
ATT: RefUnwindSafe,
NS: RefUnwindSafe,
VAL: RefUnwindSafe,
impl<NS, ATT, VAL> UnwindSafe for Attribute<NS, ATT, VAL> where
ATT: UnwindSafe,
NS: UnwindSafe,
VAL: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more