pub struct ReplaceText<O: TextOut> { /* private fields */ }Expand description
Replaces every occurrence of a fixed literal, across fragment boundaries.
The text is treated as one string however it is chunked, with the same
left-to-right, non-overlapping matches as str::replace. To do that
without holding the text, at most literal.len() - 1 bytes are carried
from one fragment to the next: the longest suffix of what has been seen
that could still begin a match. flush writes the carry out, because
nothing can complete it once the caller has declared the text at a
boundary; the renderer’s single flush at the end of a document is what
makes that safe. An empty literal matches nothing and the text passes
through unchanged, the one well-defined meaning it can have in a stream.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<O> Freeze for ReplaceText<O>where
O: Freeze,
impl<O> RefUnwindSafe for ReplaceText<O>where
O: RefUnwindSafe,
impl<O> Send for ReplaceText<O>where
O: Send,
impl<O> Sync for ReplaceText<O>where
O: Sync,
impl<O> Unpin for ReplaceText<O>where
O: Unpin,
impl<O> UnsafeUnpin for ReplaceText<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for ReplaceText<O>where
O: UnwindSafe,
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