pub enum Element {
Text(String),
Element(HtmlElement),
}
Expand description
Represents an Element.
The Html tree is either composed of HtmlElement
or raw String.
Variants§
Text(String)
Element(HtmlElement)
Implementations§
Source§impl Element
impl Element
Sourcepub fn wrap_with_element(
self,
element: HtmlElement,
mode: WrapMode,
) -> WrapResult
pub fn wrap_with_element( self, element: HtmlElement, mode: WrapMode, ) -> WrapResult
Attempts to wrap the element with the given HtmlElement.
element
: The wrapper Html element.
mode
: Defines how to wrap the element.
Sourcepub fn can_add_child(&self) -> bool
pub fn can_add_child(&self) -> bool
Indicates if the element can contain another child.
Sourcepub fn add_mut_element(&mut self, child: Box<Element>)
pub fn add_mut_element(&mut self, child: Box<Element>)
Adds without checking the child to the element.
child
: The sub-element to add.
Sourcepub fn is_allowed_in_head(&self) -> bool
pub fn is_allowed_in_head(&self) -> bool
Indicates if the element is allowed in the html document’s <head>
.
Trait Implementations§
Source§impl AddAssign for Element
impl AddAssign for Element
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreAuto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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