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§

ArrayChunksBorrowed
An iterator over overlapping chunks of a slice; see SliceBorrowed::array_chunks.
ArrayChunksOwned
An iterator over overlapping chunks of a slice; see SliceOwned::array_chunks.
ArrayWindowsBorrowed
A slice/iterator over overlapping windows of a slice; see SliceBorrowed::array_windows.
ArrayWindowsOwned
A slice/iterator over overlapping windows of a slice; see SliceOwned::array_windows.
Chain
Two chained slices; see Slice::chain.
ChunksBorrowed
An iterator over overlapping chunks of a slice; see SliceBorrowed::chunks.
ChunksOwned
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.
IterBorrowed
An iterator over a slice; see SliceBorrowed::iter.
IterOwned
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; see Slice::slice.
SplitMut
A mutable sub-slice of a Slice; see SliceMut::split_mut.
WindowsBorrowed
A slice/iterator over overlapping windows of a slice; see SliceBorrowed::windows.
WindowsOwned
A slice/iterator over overlapping windows of a slice; see SliceOwned::windows.
Zip
Two slices zipped together; see SliceOwned::zip.

Traits§

ContiguousBorrowed
A slice whose backing is contiguous in memory.
ContiguousMut
A slice whose backing is contiguous in memory.
Slice
The base trait for SliceOwned, SliceBorrowed, and SliceMut.
SliceBorrowed
A Slice that can return borrowed values.
SliceMut
A Slice that can return mutably borrowed values.
SliceOwned
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.