pub enum Whitespace {
Preserve,
Collapse,
Pedantic,
}Expand description
Whitespace handling mode, matching TinyXML2’s Whitespace enum.
Set at document construction time via ParseOptions to control how
whitespace in text content is processed during parsing.
§TinyXML2 Compatibility
| TinyXML2 | tinyxml2-rs |
|---|---|
PRESERVE_WHITESPACE | Whitespace::Preserve |
COLLAPSE_WHITESPACE | Whitespace::Collapse |
PEDANTIC_WHITESPACE | Whitespace::Pedantic |
Variants§
Preserve
Preserve all whitespace exactly as it appears in the source.
This is the default mode, matching TinyXML2’s PRESERVE_WHITESPACE.
Collapse
Collapse whitespace: strip leading/trailing, collapse internal runs to single spaces, convert all whitespace characters to spaces.
Matches TinyXML2’s COLLAPSE_WHITESPACE.
Pedantic
Pedantic whitespace preservation: like Preserve
but also keeps whitespace-only text nodes that would otherwise be
discarded.
Matches TinyXML2’s PEDANTIC_WHITESPACE.
Trait Implementations§
Source§impl Clone for Whitespace
impl Clone for Whitespace
Source§fn clone(&self) -> Whitespace
fn clone(&self) -> Whitespace
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Whitespace
Source§impl Debug for Whitespace
impl Debug for Whitespace
Source§impl Default for Whitespace
impl Default for Whitespace
Source§fn default() -> Whitespace
fn default() -> Whitespace
Returns the “default value” for a type. Read more
impl Eq for Whitespace
Source§impl PartialEq for Whitespace
impl PartialEq for Whitespace
Source§fn eq(&self, other: &Whitespace) -> bool
fn eq(&self, other: &Whitespace) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Whitespace
Auto Trait Implementations§
impl Freeze for Whitespace
impl RefUnwindSafe for Whitespace
impl Send for Whitespace
impl Sync for Whitespace
impl Unpin for Whitespace
impl UnsafeUnpin for Whitespace
impl UnwindSafe for Whitespace
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
Mutably borrows from an owned value. Read more