TakeAtom

Trait 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>

Source§

type Atom = u8

Source§

type Container = &'a [u8]

Source§

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

Source§

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

Available on crate feature unicode only.
Source§

type Atom = &'a str

Source§

type Container = &'a str

Source§

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

Available on crate feature unicode only.
Source§

type Atom = &'a str

Source§

type Container = &'a str

Source§

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

Available on crate feature unicode only.
Source§

type Atom = &'a str

Source§

type Container = &'a str

Source§

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

Source§

type Atom = u8

Source§

type Container = &'a [u8]