[−][src]Trait kul_core::text::iter::chunks::State
Enables a Text
to supply references to each of its chunks by borrowing
them from its associated Text::IterChunksState
, which must implement this
trait, which is borrowed by calls to the Text
methods, which enables the
lifetimes to be related for those methods to work.
The implementing type must be able to transition to the next states by borrowing its type from itself. E.g. slices and linked lists can do this.
Associated Types
Loading content...Required methods
fn next(&self) -> Option<(&Self::Chunk, Option<&Self>)>
Return the next chunk and the next state, or return None
when
finished.
Implementors
impl<C> State for [C] where
C: TextChunk,
[src]
C: TextChunk,
Implementation of State
for any generic slice
of chunks. Useful for Text
types that represent their chunks this
way. E.g. TextVec
uses this for its Vec
representation;
or this could be used for some fixed-size array.
impl<C, ET, '_> State for TextDatumList<'_, C, ET> where
C: TextChunk,
[src]
C: TextChunk,
Enables iterating the chunks of a TextDatumList
, by traversing the linked
list of them.
This type is its own iter::chunks::State
because the links are contained
in it.