[−][src]Struct grep_searcher::LineStep
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.
Methods
impl LineStep
[src]
pub fn new(line_term: u8, start: usize, end: usize) -> LineStep
[src]
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
.
pub fn next(&mut self, bytes: &[u8]) -> Option<(usize, usize)>
[src]
Return the start and end position of the next line in the given bytes.
The caller must past exactly the same slice of bytes for each call to
next
.
The range returned includes the line terminator. Ranges are always non-empty.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,