Struct lexical_util::iterator::Bytes [−][src]
pub struct Bytes<'a, const FORMAT: u128> { /* fields omitted */ }
Expand description
Slice iterator that skips characters matching a given value.
This wraps an iterator over a contiguous block of memory, and only returns values that are not equal to skip.
The format allows us to dictate the actual behavior of the iterator: in what contexts does it skip digit separators.
FORMAT
is required to tell us what the digit separator is, and where
the digit separators are allowed, as well tell us the radix.
The radix is required to allow us to differentiate digit from
non-digit characters (see DigitSeparators
for a detailed explanation on why).
Implementations
If each yielded value is adjacent in memory.
Get the current number of values returned by the iterator.
Get if the buffer underlying the iterator is empty.
This might not be the same thing as is_consumed
: is_consumed
checks if any more elements may be returned, which may require
peeking the next value. Consumed merely checks if the
iterator has an empty slice. It is effectively a cheaper,
but weaker variant of is_consumed()
.
Read a value of a difference type from the iterator. This advances the internal state of the iterator.
Safety
Safe as long as the number of the buffer is contains as least as many bytes as the size of V.
Try to read a value of a different type from the iterator. This advances the internal state of the iterator.
Check if the next element is a given value without case sensitivity.
Get iterator over integer digits.
Get iterator over fraction digits.
Get iterator over exponent digits.
Get iterator over special floating point values.
Advance the byte by N
elements.
Safety
As long as the iterator is at least N
elements, this
is safe.
Trait Implementations
Auto Trait Implementations
impl<'a, const FORMAT: u128> RefUnwindSafe for Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> UnwindSafe for Bytes<'a, FORMAT>
Blanket Implementations
Mutably borrows from an owned value. Read more