pub struct ReadOptions {
pub empty_text_node: bool,
pub trim_text: bool,
pub ignore_whitespace_only: bool,
pub require_decl: bool,
pub encoding: Option<String>,
}Expand description
Options when parsing xml.
Fields§
§empty_text_node: booltrue
trim_text: boolTrims leading and ending whitespaces in Node::Text, and ignore node if it is empty.
Default: true
ignore_whitespace_only: boolIgnore Node::Text that only has whitespaces.
Only makes sense if trim_text is false. (If both are true, performance takes a hit for no gain)
Default: false
require_decl: boolReturns error if document doesn’t start with XML declaration.
If there is no XML declaration, the parser won’t be able to decode encodings other than UTF-8, unless encoding below is set.
Default: true
encoding: Option<String>If this is set, the parser will start reading with this encoding.
But it will switch to XML declaration’s encoding value if it has a different value.
See encoding_rs::Encoding::for_label for valid values.
Default: None
Implementations§
Source§impl ReadOptions
impl ReadOptions
Sourcepub fn default() -> ReadOptions
pub fn default() -> ReadOptions
Create ReadOptions with default options.
Trait Implementations§
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§fn clone(&self) -> ReadOptions
fn clone(&self) -> ReadOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more