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§
- Array
Chunks Borrowed - An iterator over overlapping chunks of a slice; see
SliceBorrowed::array_chunks
. - Array
Chunks Owned - An iterator over overlapping chunks of a slice; see
SliceOwned::array_chunks
. - Array
Windows Borrowed - A slice/iterator over overlapping windows of a slice; see
SliceBorrowed::array_windows
. - Array
Windows Owned - A slice/iterator over overlapping windows of a slice; see
SliceOwned::array_windows
. - Chain
- Two chained slices; see
Slice::chain
. - Chunks
Borrowed - An iterator over overlapping chunks of a slice; see
SliceBorrowed::chunks
. - Chunks
Owned - An iterator over overlapping chunks of a slice; see
SliceOwned::chunks
. - Cycle
- An infinitely looped slice; see
Slice::cycle
. - FromFn
- A slice calling a closure on index; see
from_fn
. - Interleave
- Two interleaved slices; see
Slice::interleave
. - Iter
Borrowed - An iterator over a slice; see
SliceBorrowed::iter
. - Iter
Owned - An iterator over a slice; see
SliceOwned::iter
. - MapBorrowed
- Maps using a closure on index; see
SliceBorrowed::map
. - MapOwned
- Maps using a closure on index; see
SliceOwned::map
. - Reverse
- A reversed slice; see
Slice::rev
. - SliceOf
- A sub-slice of a
Slice
; seeSlice::slice
. - Split
Mut - A mutable sub-slice of a
Slice
; seeSliceMut::split_mut
. - Windows
Borrowed - A slice/iterator over overlapping windows of a slice; see
SliceBorrowed::windows
. - Windows
Owned - A slice/iterator over overlapping windows of a slice; see
SliceOwned::windows
. - Zip
- Two slices zipped together; see
SliceOwned::zip
.
Traits§
- Contiguous
Borrowed - A slice whose backing is contiguous in memory.
- Contiguous
Mut - A slice whose backing is contiguous in memory.
- Slice
- The base trait for
SliceOwned
,SliceBorrowed
, andSliceMut
. - Slice
Borrowed - A
Slice
that can return borrowed values. - Slice
Mut - A
Slice
that can return mutably borrowed values. - Slice
Owned - A
Slice
that can return owned values. - Unique
- A marker trait confirming that two indices of a
Slice
will never alias.
Functions§
- from_fn
- A slice made by calling a closure on the index.
Type Aliases§
- Cloned
- Clones each item on access; see
SliceBorrowed::cloned
.