Struct libxml::tree::document::Document [−][src]
A libxml2 Document
Implementations
impl Document
[src]
pub fn new() -> Result<Self, ()>
[src]
Creates a new empty libxml2 document
pub fn doc_ptr(&self) -> xmlDocPtr
[src]
Obtain the underlying libxml2 xmlDocPtr
for this Document
pub fn new_ptr(doc_ptr: xmlDocPtr) -> Self
[src]
Creates a new Document
from an existing libxml2 pointer
pub fn save_file(&self, filename: &str) -> Result<c_int, ()>
[src]
Write document to filename
pub fn get_root_element(&self) -> Option<Node>
[src]
Get the root element of the document
pub fn get_root_readonly(&self) -> Option<RoNode>
[src]
Get the root element of the document (read-only)
pub fn set_root_element(&mut self, root: &Node)
[src]
Sets the root element of the document
pub fn import_node(&mut self, node: &mut Node) -> Result<Node, ()>
[src]
Import a Node
from another Document
pub fn to_string_with_options(&self, options: SaveOptions) -> String
[src]
Serializes the Document
with options
pub fn node_to_string(&self, node: &Node) -> String
[src]
Serializes a Node
owned by this `Document
pub fn ronode_to_string(&self, node: &RoNode) -> String
[src]
Serializes a RoNode
owned by this `Document
pub fn create_processing_instruction(
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
[src]
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
Creates a node for an XML processing instruction
pub fn as_node(&self) -> Node
[src]
Cast the document as a libxml Node
pub fn dup(&self) -> Result<Self, ()>
[src]
Duplicates the libxml2 Document into a new instance
pub fn dup_from(&mut self, source: &Self) -> Result<(), ()>
[src]
Duplicates a source libxml2 Document into the empty Document self
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl !UnwindSafe for Document
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,