Struct lexical_util::iterator::Bytes
source · pub struct Bytes<'a, const FORMAT: u128> { /* private fields */ }
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§
source§impl<'a, const FORMAT: u128> Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> Bytes<'a, FORMAT>
sourcepub fn integer_iter<'b>(&'b mut self) -> IntegerDigitsIterator<'a, 'b, FORMAT>
pub fn integer_iter<'b>(&'b mut self) -> IntegerDigitsIterator<'a, 'b, FORMAT>
Get iterator over integer digits.
sourcepub fn fraction_iter<'b>(&'b mut self) -> FractionDigitsIterator<'a, 'b, FORMAT>
pub fn fraction_iter<'b>(&'b mut self) -> FractionDigitsIterator<'a, 'b, FORMAT>
Get iterator over fraction digits.
sourcepub fn exponent_iter<'b>(&'b mut self) -> ExponentDigitsIterator<'a, 'b, FORMAT>
pub fn exponent_iter<'b>(&'b mut self) -> ExponentDigitsIterator<'a, 'b, FORMAT>
Get iterator over exponent digits.
sourcepub fn special_iter<'b>(&'b mut self) -> SpecialDigitsIterator<'a, 'b, FORMAT>
pub fn special_iter<'b>(&'b mut self) -> SpecialDigitsIterator<'a, 'b, FORMAT>
Get iterator over special floating point values.
Trait Implementations§
source§impl<'a, const FORMAT: u128> Iter<'a> for Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> Iter<'a> for Bytes<'a, FORMAT>
source§const IS_CONTIGUOUS: bool = _
const IS_CONTIGUOUS: bool = _
If each yielded value is adjacent in memory.
source§unsafe fn set_cursor(&mut self, index: usize)
unsafe fn set_cursor(&mut self, index: usize)
source§fn current_count(&self) -> usize
fn current_count(&self) -> usize
Get the current number of digits returned by the iterator.
For contiguous iterators, this can include the sign character, decimal point, and the exponent sign (that is, it is always the cursor). For non-contiguous iterators, this must always be the only the number of digits returned.
source§fn get_buffer(&self) -> &'a [u8] ⓘ
fn get_buffer(&self) -> &'a [u8] ⓘ
source§unsafe fn step_by_unchecked(&mut self, count: usize)
unsafe fn step_by_unchecked(&mut self, count: usize)
N
elements. Read moresource§unsafe fn peek_many_unchecked<V>(&self) -> V
unsafe fn peek_many_unchecked<V>(&self) -> V
source§fn buffer_length(&self) -> usize
fn buffer_length(&self) -> usize
source§fn is_buffer_empty(&self) -> bool
fn is_buffer_empty(&self) -> bool
source§fn is_contiguous(&self) -> bool
fn is_contiguous(&self) -> bool
source§fn first(&self) -> Option<&'a u8>
fn first(&self) -> Option<&'a u8>
source§fn first_is_cased(&self, value: u8) -> bool
fn first_is_cased(&self, value: u8) -> bool
source§fn first_is_uncased(&self, value: u8) -> bool
fn first_is_uncased(&self, value: u8) -> bool
source§fn first_is(&self, value: u8, is_cased: bool) -> bool
fn first_is(&self, value: u8, is_cased: bool) -> bool
source§unsafe fn step_unchecked(&mut self)
unsafe fn step_unchecked(&mut self)
Auto Trait Implementations§
impl<'a, const FORMAT: u128> Freeze for Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> RefUnwindSafe for Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> Send for Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> Sync for Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> Unpin for Bytes<'a, FORMAT>
impl<'a, const FORMAT: u128> UnwindSafe for Bytes<'a, FORMAT>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)