pub struct Document(/* private fields */);
Expand description
A libxml2 Document
Implementations§
Source§impl Document
impl Document
Sourcepub fn new_ptr(doc_ptr: xmlDocPtr) -> Self
pub fn new_ptr(doc_ptr: xmlDocPtr) -> Self
Creates a new Document
from an existing libxml2 pointer
Sourcepub fn get_root_element(&self) -> Option<Node>
pub fn get_root_element(&self) -> Option<Node>
Get the root element of the document
Sourcepub fn get_root_readonly(&self) -> Option<RoNode>
pub fn get_root_readonly(&self) -> Option<RoNode>
Get the root element of the document (read-only)
Sourcepub fn set_root_element(&mut self, root: &Node)
pub fn set_root_element(&mut self, root: &Node)
Sets the root element of the document
Sourcepub fn import_node(&mut self, node: &mut Node) -> Result<Node, ()>
pub fn import_node(&mut self, node: &mut Node) -> Result<Node, ()>
Import a Node
from another Document
Sourcepub fn to_string_with_options(&self, options: SaveOptions) -> String
pub fn to_string_with_options(&self, options: SaveOptions) -> String
Serializes the Document
with options
Sourcepub fn node_to_string(&self, node: &Node) -> String
pub fn node_to_string(&self, node: &Node) -> String
Serializes a Node
owned by this Document
Sourcepub fn ronode_to_string(&self, node: &RoNode) -> String
pub fn ronode_to_string(&self, node: &RoNode) -> String
Serializes a RoNode
owned by this Document
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl !RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl !UnwindSafe 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