Trait InputIter
pub trait InputIter {
type Item;
type Iter: Iterator<Item = (usize, Self::Item)>;
type IterElem: Iterator<Item = Self::Item>;
// Required methods
fn iter_indices(&self) -> Self::Iter;
fn iter_elements(&self) -> Self::IterElem;
fn position<P>(&self, predicate: P) -> Option<usize>
where P: Fn(Self::Item) -> bool;
fn slice_index(&self, count: usize) -> Result<usize, Needed>;
}Available on crate feature
rustls only.Expand description
Abstracts common iteration operations on the input type
Required Associated Types§
type Item
type Item
The current input type is a sequence of that Item type.
Example: u8 for &[u8] or char for &str
Required Methods§
fn iter_indices(&self) -> Self::Iter
fn iter_indices(&self) -> Self::Iter
Returns an iterator over the elements and their byte offsets
fn iter_elements(&self) -> Self::IterElem
fn iter_elements(&self) -> Self::IterElem
Returns an iterator over the elements
fn slice_index(&self, count: usize) -> Result<usize, Needed>
fn slice_index(&self, count: usize) -> Result<usize, Needed>
Get the byte offset from the element’s position in the stream
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".