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
true
trim_text: bool
Trims leading and ending whitespaces in Node::Text
, and ignore node if it is empty.
Default: true
ignore_whitespace_only: bool
Ignore 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: bool
Returns 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 moreSource§impl Debug for ReadOptions
impl Debug for ReadOptions
Source§impl PartialEq for ReadOptions
impl PartialEq for ReadOptions
impl Eq for ReadOptions
impl StructuralPartialEq for ReadOptions
Auto Trait Implementations§
impl Freeze for ReadOptions
impl RefUnwindSafe for ReadOptions
impl Send for ReadOptions
impl Sync for ReadOptions
impl Unpin for ReadOptions
impl UnwindSafe for ReadOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.