[][src]Crate array_tools

Array Tools

Crate Documentation Build Status Build status

A collection of tools to help dealing with our beloved ❤️ fixed size arrays (Including generic contexts).

Stability notice

Requires nightly.

This crate depends on FixedSizeArray trait, which is currently experimental. Because of this, crate is experimental as well. No other sources of severe breakage should be expected.

Features

  • Metafeature: all features below should work for arrays of any size.
  • Initialization with iterator.
  • Initialization with function (with or without index as argument).
  • Consuming iterator.
  • Consuming chunks iterator.
  • Consuming split.
  • Consuming join.
  • No dependency on std and no heap allocations, thanks to underlaying fixed-capacity stack-allocated deque-like structure.

Examples

See documentation for examples, it covers most if not all use cases.

Contributing

Contributions of any shape and form are welcome.

Structs

Chunks

A consuming iterator over non-overlaping subarrays of equal size.

IntoIter

A consuming iterator over array elements.

Enums

Chunk

An item of Chunks iterator.

Functions

indexed_init_withDeprecated

Alias for init_by_index_with.

init_by_index_with

Creates a new array instance filled with values generated by a given function. This variant expects a function with single argument - an index of element to initialize.

init_with

Creates a new array instance filled with values generated by a given function. This variant expects function without arguments.

join

Joins two arrays.

length_of

Returns the length of array.

split

Splits array into two subarrays.

try_init_from_iterator

Attempts to create instance of array from iterator.

try_init_from_slice

Attempts to create instance of array from slice.

Type Definitions

ArrayChunkDeprecated

Alias for Chunk.

ArrayChunksDeprecated

Alias for Chunks.

ArrayIntoIteratorDeprecated

Alias for IntoIter.