Expand description
§str chunks
implements char-wise chunked iteration of str
the methods str_chunks
, str_chunks_exact
, str_rchunks
, and str_rchunks_exact
behave like the similarly named methods on slice,
but return string slices that are chunk_size
chars long.
take note: these slices are not necessarily chunk_size
bytes long. chunk.len() != chunk_size
import ImplStrChunks
to get methods on &str
For DoubleEndedIterator
support, use the reversable
method.
This is not a trivial operation, and it is recommended to avoid it if possible.
Structs§
- Double
Ended - A double-ended variant of a strchunks variant.
This struct is created by the
reversable
method on any strchunks variant. - StrChunks
- An iterator over a str in (non-overlapping) chunks (
chunk_size
chars at a time) starting at the beginning of the str. - StrChunks
Exact - An iterator over a str in (non-overlapping) chunks (
chunk_size
chars at a time) starting at the beginning of the str. - StrR
Chunks - An iterator over a str in (non-overlapping) chunks (
chunk_size
chars at a time) starting at the end of the str. - StrR
Chunks Exact - An iterator over a str in (non-overlapping) chunks (
chunk_size
chars at a time) starting at the end of the str.
Traits§
- Impl
StrChunks - Trait implemented on &str to provide convenience methods.