Struct vtd_xml::VtdGen
[−]
[src]
pub struct VtdGen { pub vtd_gen: *mut VTDGen, // some fields omitted }
Parses the XMLs and owns the index.
Fields
vtd_gen: *mut VTDGen
Methods
impl VtdGen
[src]
fn new() -> VtdGen
fn parse_file<P: AsRef<Path>>(&mut self,
ns: bool,
path: P)
-> Result<(), String>
ns: bool,
path: P)
-> Result<(), String>
Tells VTD-XML to parse the given file.
NB: VTD-XML reads the file into a malloc
memory buffer.
If you don't want that extra copy then use the parse_mmap
method instead.
ns
- Whether to turn the XML namespaces support on.path
- Location of the XML file.
fn parse_mmap<P: AsRef<Path>>(&mut self,
ns: bool,
path: P)
-> Result<(), String>
ns: bool,
path: P)
-> Result<(), String>
Maps the file into RAM and tells VTD-XML to parse it.
ns
- Whether to turn the XML namespaces support on.path
- Location of the XML file.
fn parse_vec(&mut self,
ns: bool,
vec: Rc<Vec<u8>>,
offset: usize,
len: usize)
-> Result<(), String>
ns: bool,
vec: Rc<Vec<u8>>,
offset: usize,
len: usize)
-> Result<(), String>
Tells VTD-XML to parse the given part of a byte vector.
The parsed slice is not copied, it is merely referenced (borrowed) by the VTD-XML.
ns
- Whether to turn the XML namespaces support on.