[−][src]Struct libxml::tree::document::Document
A libxml2 Document
Methods
impl Document
[src]
impl Document
pub fn new() -> Result<Self, ()>
[src]
pub fn new() -> Result<Self, ()>
Creates a new empty libxml2 document
pub fn doc_ptr(&self) -> xmlDocPtr
[src]
pub fn doc_ptr(&self) -> xmlDocPtr
Obtain the underlying libxml2 xmlDocPtr
for this Document
pub fn new_ptr(doc_ptr: xmlDocPtr) -> Self
[src]
pub fn new_ptr(doc_ptr: xmlDocPtr) -> Self
Creates a new Document
from an existing libxml2 pointer
pub fn save_file(&self, filename: &str) -> Result<c_int, ()>
[src]
pub fn save_file(&self, filename: &str) -> Result<c_int, ()>
Write document to filename
pub fn get_root_element(&self) -> Option<Node>
[src]
pub fn get_root_element(&self) -> Option<Node>
Get the root element of the document
pub fn set_root_element(&mut self, root: &Node)
[src]
pub fn set_root_element(&mut self, root: &Node)
Sets the root element of the document
pub fn import_node(&mut self, node: &mut Node) -> Result<Node, ()>
[src]
pub fn import_node(&mut self, node: &mut Node) -> Result<Node, ()>
Import a Node
from another Document
pub fn to_string(&self, format: bool) -> String
[src]
pub fn to_string(&self, format: bool) -> String
Serializes the Document
pub fn node_to_string(&self, node: &Node) -> String
[src]
pub fn node_to_string(&self, node: &Node) -> String
Serializes a Node
owned by this `Document
pub fn create_processing_instruction(
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
[src]
pub fn create_processing_instruction(
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
Creates a node for an XML processing instruction
pub fn as_node(&self) -> Node
[src]
pub fn as_node(&self) -> Node
Cast the document as a libxml Node
pub fn dup(&self) -> Result<Self, ()>
[src]
pub fn dup(&self) -> Result<Self, ()>
Duplicates the libxml2 Document into a new instance
pub fn dup_from(&mut self, source: &Self) -> Result<(), ()>
[src]
pub fn dup_from(&mut self, source: &Self) -> Result<(), ()>
Duplicates a source libxml2 Document into the empty Document self
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more