[−][src]Struct marked::Element
A markup element with name and attributes.
Fields
name: QualName
attrs: Vec<Attribute>
Implementations
impl Element
[src]
pub fn new<LN>(lname: LN) -> Element where
LN: Into<LocalName>,
[src]
LN: Into<LocalName>,
Construct new element by local name, with no attributes.
pub fn is_elem<LN>(&self, lname: LN) -> bool where
LN: Into<LocalName>,
[src]
LN: Into<LocalName>,
Return true if this element has the given local name.
pub fn html_tag_meta(&self) -> Option<&'static TagMeta>
[src]
Return html::TagMeta
for this element, if the tag is a known part
of the HTML Namespace
.
pub fn attr<LN>(&self, lname: LN) -> Option<&StrTendril> where
LN: Into<LocalName>,
[src]
LN: Into<LocalName>,
Return attribute value by local name, if present.
pub fn remove_attr<LN>(&mut self, lname: LN) -> Option<StrTendril> where
LN: Into<LocalName>,
[src]
LN: Into<LocalName>,
Remove attribute by local name, returning any value found.
This removes all instances of attributes with the given local name and returns the value of the last such attribute. Parsers may allow same named attributes or multiples might be introduced via manual mutations.
pub fn set_attr<LN, V>(&mut self, lname: LN, value: V) -> Option<StrTendril> where
LN: Into<LocalName>,
V: Into<StrTendril>,
[src]
LN: Into<LocalName>,
V: Into<StrTendril>,
Set attribute by local name, returning any prior value found.
This replaces the value of the first attribute with the given local
name and removes any other instances. If no existing attribute is
found, the attribute is added to the end. To guarantee placement at the
end, use Element::remove_attr
first. In the case where multiple
existing instances of the attribute are found, the last value is
returned. Parsers may allow same named attributes or multiples might
be introduced via manual mutations.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Element
[src]
impl !Send for Element
[src]
impl !Sync for Element
[src]
impl Unpin for Element
[src]
impl UnwindSafe for Element
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,