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: bool<tag></tag> will have a Node::Text(“”) as its children, while <tag /> won’t.
Default: true
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
Trait Implementations§
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§fn clone(&self) -> ReadOptions
fn clone(&self) -> ReadOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReadOptions
impl Debug for ReadOptions
Source§impl Default for ReadOptions
impl Default for ReadOptions
impl Eq for ReadOptions
Source§impl PartialEq for ReadOptions
impl PartialEq for ReadOptions
Source§fn eq(&self, other: &ReadOptions) -> bool
fn eq(&self, other: &ReadOptions) -> bool
self and other values to be equal, and is used by ==.