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

If each yielded value is adjacent in memory.

Create new byte object.

Get a ptr to the current start of the iterator.

Get a slice to the current start of the iterator.

Get the total number of elements in the underlying slice.

Get the current index of the iterator in the slice.

Set the current index of the iterator in the slice.

Safety

Safe if index <= self.length().

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.

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.

Advance the byte by 1 element.

Safety

Safe as long as the iterator is not empty.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.