Skip to content

Iterator Interface #60

@Dr-Emann

Description

@Dr-Emann

We may (and I have plans for aarch64 at least) be able to expose a way to iterate over the indexes of the haystack which matches one of our bytes which is more efficient than simply calling .find repeatedly.

We should expose an interface like

pub struct BytesIter<F> { /* impl details */ }

impl Bytes<F> {
  pub fn iter(&self, haystack: &[u8]) -> BytesIter<F> { ... }
}

pub struct AsciiCharsIter<F>(BytesIter<F>);

impl AsciiChars<F> {
  pub fn iter(&self, haystack: &str) -> AsciiCharsIter<F> { AsciiCharsIter(self.0.iter(haystack.as_bytes()) }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions