Struct libxml::tree::document::Document[][src]

pub struct Document(_);

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]

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

impl Clone for Document[src]

impl Display for Document[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.