struct StartTrimmer {
trim_start: bool,
}
Expand description
Helper struct that contains a state for an algorithm of converting events from raw events to semi-trimmed events that is independent from a way of events reading.
Fields§
§trim_start: bool
If true
, then leading whitespace will be removed from next returned
Event::Text
. This field is set to true
after reading each event
except Event::Text
and Event::CData
, so Event::Text
events
read right after them does not trimmed.
Implementations§
Source§impl StartTrimmer
impl StartTrimmer
Sourcefn trim<'a>(&mut self, event: Event<'a>) -> Option<PayloadEvent<'a>>
fn trim<'a>(&mut self, event: Event<'a>) -> Option<PayloadEvent<'a>>
Converts raw reader’s event into a payload event.
Returns None
, if event should be skipped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StartTrimmer
impl RefUnwindSafe for StartTrimmer
impl Send for StartTrimmer
impl Sync for StartTrimmer
impl Unpin for StartTrimmer
impl UnwindSafe for StartTrimmer
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