Crate slice_utils
source ·Expand description
§::slice-utils
See Slice
and children.
This is a collection of utilities for slices, similar to those found on
iterators. The goal is to be as close to feature-parity with iterators as
possible, while maintaining no_std
compatibility.
The core of this crate is providing non-contiguous slices. For example,
Slice::chain
allows you to join two slices together, clearly breaking
continuity. This results in an Iterator
-like API.
§License
Licensed under the MIT license.
Structs§
- An iterator over overlapping chunks of a slice; see
SliceBorrowed::array_chunks
. - An iterator over overlapping chunks of a slice; see
SliceOwned::array_chunks
. - A slice/iterator over overlapping windows of a slice; see
SliceBorrowed::array_windows
. - A slice/iterator over overlapping windows of a slice; see
SliceOwned::array_windows
. - Two chained slices; see
Slice::chain
. - An iterator over overlapping chunks of a slice; see
SliceBorrowed::chunks
. - An iterator over overlapping chunks of a slice; see
SliceOwned::chunks
. - An infinitely looped slice; see
Slice::cycle
. - A slice calling a closure on index; see
from_fn
. - Two interleaved slices; see
Slice::interleave
. - An iterator over a slice; see
SliceBorrowed::iter
. - An iterator over a slice; see
SliceOwned::iter
. - Maps using a closure on index; see
SliceBorrowed::map
. - Maps using a closure on index; see
SliceOwned::map
. - A reversed slice; see
Slice::rev
. - A sub-slice of a
Slice
; seeSlice::slice
. - A slice/iterator over overlapping windows of a slice; see
SliceBorrowed::windows
. - A slice/iterator over overlapping windows of a slice; see
SliceOwned::windows
. - Two slices zipped together; see
SliceOwned::zip
.
Traits§
- A
Slice
that can return borrowed values. - A
Slice
that can return mutably borrowed values. - A
Slice
that can return owned values.
Functions§
- A slice made by calling a closure on the index.
Type Aliases§
- Clones each item on access; see
SliceBorrowed::cloned
.