tasm_lib/list.rs
1//! List operations, mimicking [`Vec`] in some ways (but not in others).
2//!
3//! Lists may only contain elements whose type has
4//! [static size](crate::BFieldCodec::static_length).
5//!
6//! Like [`Vec`], a list can be [created][self::new::New],
7//! [pushed to][self::push::Push], [popped from][self::pop::Pop],
8//! [written to][self::set::Set], and asked for its
9//! [length][self::length::Length], among other operations.
10//!
11//! Unlike [`Vec`], lists do not track their capacity. Instead, list created at
12//! Triton VM's runtime get access to an entire [memory page][crate::memory].
13//! Lists spawned in Triton VM's memory through
14//! [non-determinism][crate::triton_vm::prelude::NonDeterminism] might have
15//! access to smaller memory regions. As with all non-determinism, handling them
16//! requires additional care.
17
18/// The number of VM words required to store the metadata / bookkeeping data of a list.
19pub const LIST_METADATA_SIZE: usize = 1;
20
21pub mod contains;
22pub mod get;
23pub mod higher_order;
24pub mod horner_evaluation_dynamic_length;
25pub mod length;
26pub mod multiset_equality_digests;
27pub mod multiset_equality_u64s;
28pub mod new;
29pub mod pop;
30pub mod push;
31pub mod range;
32pub mod set;
33pub mod set_length;
34pub mod split_off;
35pub mod sum_bfes;
36pub mod sum_xfes;
37pub mod swap_unchecked;