pub struct Element {
pub pointer: ElementPtr,
pub tag_name: String,
pub attributes: Vec<Attribute>,
pub contents: Vec<Content>,
pub is_alive: bool,
pub id: Option<String>,
pub classes: Vec<String>,
/* private fields */
}Fields
pointer: ElementPtrtag_name: Stringattributes: Vec<Attribute>contents: Vec<Content>is_alive: boolid: Option<String>for HTML
classes: Vec<String>for HTML
Implementations
sourceimpl Element
impl Element
pub fn new(
tag_name: String,
attributes: Vec<Attribute>,
empty_element: bool,
contents: Vec<Content>
) -> ElementPtr
pub fn from_string(string: String) -> Result<ElementPtr, Vec<String>>
pub fn add_contents(&mut self, contents: Vec<Content>)
pub fn add_element_ptr(&mut self, element_ptr: ElementPtr)
pub fn add_char_data(&mut self, char_data: String)
pub fn get_attribute(&self, attribute: String) -> Option<String>
pub fn set_attribute(&mut self, attribute: String, value: String)
pub fn has_unique_attributes(&self) -> bool
pub fn get_parent(&self) -> Option<ElementPtr>
pub fn set_parent(&mut self, parent: ElementPtr)
pub fn get_children(&self) -> Vec<ElementPtr>
pub fn set_parent_recursive(&mut self)
pub fn to_string(&self) -> String
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more