Struct grep_searcher::LineStep
source · pub struct LineStep { /* private fields */ }
Expand description
An explicit iterator over lines in a particular slice of bytes.
This iterator avoids borrowing the bytes themselves, and instead requires callers to explicitly provide the bytes when moving through the iterator. While not idiomatic, this provides a simple way of iterating over lines that doesn’t require borrowing the slice itself, which can be convenient.
Line terminators are considered part of the line they terminate. All lines yielded by the iterator are guaranteed to be non-empty.
Implementations§
source§impl LineStep
impl LineStep
sourcepub fn new(line_term: u8, start: usize, end: usize) -> LineStep
pub fn new(line_term: u8, start: usize, end: usize) -> LineStep
Create a new line iterator over the given range of bytes using the given line terminator.
Callers should provide the actual bytes for each call to next
. The
same slice must be provided to each call.
This panics if start
is not less than or equal to end
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LineStep
impl Send for LineStep
impl Sync for LineStep
impl Unpin for LineStep
impl UnwindSafe for LineStep
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