Skip to main content

Module sarray

Module sarray 

Source
Expand description

Lean’s unboxed arrays: ByteArray and FloatArray.

Each is a Vec of the element type inside a Lean object, so a Vec<u8> or Vec<f64> moves in and out without conversion. As in lean.h: an array a function changes is consumed, arrays and indexes that are only read are borrowed, results are owned.

Functions§

byte_array_compare⚠
An Ordering: 0 for less, 1 for equal, 2 for greater.
byte_array_copy_slice⚠
target with len bytes of source from source_offset written over it at target_offset. The result ends where the copied bytes end if they reach past the end of target. Consumes target.
byte_array_data⚠
The bytes as an Array UInt8. Consumes a.
byte_array_dec_lt⚠
byte_array_fget⚠
byte_array_from_vec
A ByteArray that takes over the buffer of bytes.
byte_array_fset⚠
byte_array_get⚠
Lean’s bytes[i]!: an index outside the array is a panic.
byte_array_hash⚠
byte_array_into_vec⚠
The bytes of a ByteArray, giving up one reference to it.
byte_array_mk⚠
A ByteArray from an Array UInt8, which it consumes.
byte_array_push⚠
byte_array_set⚠
Lean’s bytes.set! i b: an index outside the array is a panic.
byte_array_size⚠
byte_array_uget⚠
byte_array_uset⚠
bytes⚠
The bytes of a ByteArray.
float_array_data⚠
The values as an Array Float. Consumes a.
float_array_fget⚠
float_array_from_vec
A FloatArray that takes over the buffer of values.
float_array_fset⚠
float_array_get⚠
Lean’s values[i]!: an index outside the array is a panic.
float_array_into_vec⚠
The values of a FloatArray, giving up one reference to it.
float_array_mk⚠
A FloatArray from an Array Float, which it consumes.
float_array_push⚠
float_array_set⚠
float_array_size⚠
float_array_uget⚠
float_array_uset⚠
mk_empty_byte_array⚠
mk_empty_float_array⚠
sarray_dec_eq⚠
Whether two arrays of the same kind hold the same bits.
sarray_mark_linear⚠
See array::array_mark_linear: the mark has no effect on values.
sarray_propagate_mark⚠
sarray_size⚠