pub struct Document {
pub html: DomNode,
pub head: DomNode,
pub body: DomNode,
pub title: Rc<RefCell<String>>,
pub mutated: Rc<RefCell<bool>>,
pub mutation_sink: Rc<RefCell<MutationSink>>,
}Expand description
W3C-compliant document node container holding root, head, body, and DOM elements.
Fields§
§html: DomNode§head: DomNode§body: DomNode§title: Rc<RefCell<String>>§mutated: Rc<RefCell<bool>>§mutation_sink: Rc<RefCell<MutationSink>>Implementations§
Source§impl Document
impl Document
pub fn new() -> Self
pub fn mark_mutated(&self)
pub fn has_mutated(&self) -> bool
pub fn clear_mutated(&self)
pub fn add_mutation_listener<F>(&self, listener: F)where
F: FnMut(&DomMutationRecord) + 'static,
pub fn set_mutation_channel(&self, sender: Sender<DomMutationRecord>)
pub fn drain_mutations(&self) -> Vec<DomMutationRecord>
pub fn pending_mutations(&self) -> Vec<DomMutationRecord>
pub fn from_html(html_str: &str) -> Self
pub fn create_element(&self, tag: &str) -> DomNode
pub fn create_text_node(&self, text: &str) -> DomNode
pub fn create_comment(&self, comment: &str) -> DomNode
pub fn get_element_by_id(&self, id: &str) -> Option<DomNode>
pub fn get_element_by_uid(&self, uid: u64) -> Option<DomNode>
pub fn query_selector(&self, selector: &str) -> Option<DomNode>
pub fn query_selector_all(&self, selector: &str) -> Vec<DomNode>
pub fn to_html(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl !UnwindSafe for Document
impl Forget for Document
impl Freeze for Document
impl Move for Document
impl Unpin for Document
impl UnsafeUnpin for Document
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