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
impl<NS, ATT, VAL> Attribute<NS, ATT, VAL> where
NS: PartialEq<NS> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug,
impl<NS, ATT, VAL> Attribute<NS, ATT, VAL> where
NS: PartialEq<NS> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug,
pub fn new(
namespace: Option<NS>,
name: ATT,
value: VAL
) -> Attribute<NS, ATT, VAL>
pub fn new(
namespace: Option<NS>,
name: ATT,
value: VAL
) -> Attribute<NS, ATT, VAL>
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
Trait Implementations
sourceimpl<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,
sourcepub fn map_msg<F, MSG2>(
self,
func: F
) -> Attribute<&'static str, &'static str, AttributeValue<MSG2>> where
F: 'static + Fn(MSG) -> MSG2,
MSG2: 'static,
pub fn map_msg<F, MSG2>(
self,
func: F
) -> Attribute<&'static str, &'static str, AttributeValue<MSG2>> where
F: 'static + Fn(MSG) -> MSG2,
MSG2: 'static,
map the msg
sourcepub 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
impl<NS, ATT, VAL> Clone for Attribute<NS, ATT, VAL> where
NS: Clone + PartialEq<NS> + Debug,
ATT: Clone + PartialEq<ATT> + Debug,
VAL: Clone + PartialEq<VAL> + Debug,
impl<NS, ATT, VAL> Clone for Attribute<NS, ATT, VAL> where
NS: Clone + PartialEq<NS> + Debug,
ATT: Clone + PartialEq<ATT> + Debug,
VAL: Clone + PartialEq<VAL> + Debug,
impl<NS, ATT, VAL> Debug for Attribute<NS, ATT, VAL> where
NS: Debug + PartialEq<NS> + Clone,
ATT: Debug + PartialEq<ATT> + Clone,
VAL: Debug + PartialEq<VAL> + Clone,
impl<NS, ATT, VAL> Debug for Attribute<NS, ATT, VAL> where
NS: Debug + PartialEq<NS> + Clone,
ATT: Debug + PartialEq<ATT> + Clone,
VAL: Debug + PartialEq<VAL> + Clone,
impl<NS, ATT, VAL> PartialEq<Attribute<NS, ATT, VAL>> for Attribute<NS, ATT, VAL> where
NS: PartialEq<NS> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug,
impl<NS, ATT, VAL> PartialEq<Attribute<NS, ATT, VAL>> for Attribute<NS, ATT, VAL> where
NS: PartialEq<NS> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug,
sourceimpl<MSG> Render for Attribute<&'static str, &'static str, AttributeValue<MSG>>
impl<MSG> Render for Attribute<&'static str, &'static str, AttributeValue<MSG>>
sourcepub fn render_with_indent(
&self,
buffer: &mut dyn Write,
_indent: usize,
_compressed: bool
) -> Result<(), Error>
pub fn render_with_indent(
&self,
buffer: &mut dyn Write,
_indent: usize,
_compressed: bool
) -> Result<(), Error>
render instance to a writable buffer with indention
sourcefn render(&self, buffer: &mut dyn Write) -> Result<(), Error>
fn render(&self, buffer: &mut dyn Write) -> Result<(), Error>
render the node to a writable buffer
sourcefn render_compressed(&self, buffer: &mut dyn Write) -> Result<(), Error>
fn render_compressed(&self, buffer: &mut dyn Write) -> Result<(), Error>
no new_lines, no indents
sourcefn render_to_string(&self) -> String
fn render_to_string(&self) -> String
render compressed html to string
sourcefn render_to_string_pretty(&self) -> String
fn render_to_string_pretty(&self) -> String
render to string with nice indention
impl<NS, ATT, VAL> StructuralPartialEq for Attribute<NS, ATT, VAL> where
NS: PartialEq<NS> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug,
Auto Trait Implementations
impl<NS, ATT, VAL> RefUnwindSafe for Attribute<NS, ATT, VAL> where
ATT: RefUnwindSafe,
NS: RefUnwindSafe,
VAL: RefUnwindSafe,
impl<NS, ATT, VAL> Send for Attribute<NS, ATT, VAL> where
ATT: Send,
NS: Send,
VAL: Send,
impl<NS, ATT, VAL> Sync for Attribute<NS, ATT, VAL> where
ATT: Sync,
NS: Sync,
VAL: Sync,
impl<NS, ATT, VAL> Unpin for Attribute<NS, ATT, VAL> where
ATT: Unpin,
NS: Unpin,
VAL: Unpin,
impl<NS, ATT, VAL> UnwindSafe for Attribute<NS, ATT, VAL> where
ATT: UnwindSafe,
NS: UnwindSafe,
VAL: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more