Trait pipe_chain::TakeAtom

source ·
pub trait TakeAtom {
    type Atom: LenBytes;
    type Container;

    // Required methods
    fn next(&mut self) -> Option<(usize, Self::Atom)>;
    fn split_at(self, index: usize) -> (Self::Container, Self::Container);
}
Expand description

Implemented by types usable with take_while

Required Associated Types§

source

type Atom: LenBytes

a single element

source

type Container

a container of TakeAtom::Atom

Required Methods§

source

fn next(&mut self) -> Option<(usize, Self::Atom)>

Gets the next TakeAtom::Atom and it’s index in the container

source

fn split_at(self, index: usize) -> (Self::Container, Self::Container)

returns a tuple containing (remaining, consumed) where consumed contains all of the items returned by TakeAtom::next

Implementors§

source§

impl<'a> TakeAtom for ByteAtom<'a>

§

type Atom = u8

§

type Container = &'a [u8]

source§

impl<'a> TakeAtom for CharAtom<'a>

§

type Atom = char

§

type Container = &'a str

source§

impl<'a> TakeAtom for GraphemeAtom<'a>

§

type Atom = &'a str

§

type Container = &'a str

source§

impl<'a> TakeAtom for SentenceAtom<'a>

§

type Atom = &'a str

§

type Container = &'a str

source§

impl<'a> TakeAtom for WordAtom<'a>

§

type Atom = &'a str

§

type Container = &'a str

source§

impl<'a, const N: usize> TakeAtom for ConstByteAtom<'a, N>

§

type Atom = u8

§

type Container = &'a [u8]