Skip to main content

Module layout

Module layout 

Source
Expand description

Array shapes, axis keys and names, and their limits.

Structs§

Keys
Names for the positions on one axis. A position may have no name. The names that are present are unique.
Lanes
An array’s items as lanes along one axis: outer lanes before it, each len items long, with inner items between neighbours along it.
Layout
An array’s shape, with optional keys and a name for each axis. A layout with no keys or names holds no Meta.
Shape
An array’s shape: the length of each axis. Ranks 0 to 2 are held inline with no allocation, and higher ranks in one allocation of exactly their length. Convert a Vec, an array or a slice of lengths into one, or collect it from lengths.

Enums§

Alignment
How the positions of one axis’s keys lie along those of a result axis, as Keys::aligned and Keys::union give it.

Constants§

FRESH
The character between a fresh name’s stem and its random part. shown cuts a hidden name after it.
MAX_GENERATED_ELEMENTS
The most items in an array that a function makes.
MAX_RANK
The most axes an array can have.

Functions§

agreed
The value that every present item of values equals. Absent items don’t count. Two different values give none.
coordinates
Each axis’s coordinate of flat position flat, from the last axis to the first. flat must be within the shape.
count
The number of items in an array of shape that already exists. Unlike element_count, it checks neither the rank nor overflow. Ranks 0 to 2 compute it inline.
element_count
The number of items in an array of shape. A Limit error when shape has more than MAX_RANK axes, or more items than a usize counts.
exclusive_sums
The offsets of parts of sizes laid end to end, each the sum of the sizes before it.
generated_len
The number of items in an array of shape that a function makes. A Limit error past MAX_GENERATED_ELEMENTS, or where the array would take the process past its memory guard’s limit (memory::admit).
hidden
Whether an axis name is hidden: it starts with _. Hidden and visible names are separate namespaces.
names_conflict
Whether two axis names conflict: both are names, they differ, and they’re in the same namespace. A name meets a name from the other namespace as if that axis were unnamed.
position
The position among len that n gives, counting from the end when negative. None outside the range.
repeated_name
The first name that appears more than once in names.
shown
name as messages and display show it: a hidden name that holds FRESH cut after the last one, as in _b·…. Any other name stays as it is.
strides
The distance between neighbouring items along each axis of an array of shape.