aztec-nr - protocol_types::utils::arrays

Struct ClaimedLengthArray

pub struct ClaimedLengthArray<T, let N: u32> {
    pub array: [T; N],
    pub length: u32,
}

ClaimedLengthArray - An array interpreted by Kernel circuits. Its length is merely a claim that must eventually be validated. Validation must include:

Fields

array: [T; N]
length: u32

Implementations

impl<let N: u32, T> ClaimedLengthArray<T, N>

pub fn assert_dense_trimmed(self)
where T: Empty
pub fn assert_empty<let S: u32>(self, msg: str<S>)
where T: Empty
pub fn assert_length_within_bounds<let S: u32>(self, msg: str<S>)
where T: Empty
pub fn push(&mut self, item: T)
where T: Empty
pub fn pop(&mut self) -> T
where T: Empty
pub fn for_each<Env>(self, f: fn[Env](T))
where T: Empty
pub fn for_each_i<Env>(self, f: fn[Env](T, u32))
where T: Empty
pub fn from_bounded_vec(vec: BoundedVec<T, N>) -> Self
where T: Empty

Trait implementations

impl<let N: u32, T> Deserialize for ClaimedLengthArray<T, N>
where T: Deserialize

pub fn deserialize( serialized: [Field; N * <(resolved type) as Deserialize>::N + 1], ) -> Self

impl<let N: u32, T> Empty for ClaimedLengthArray<T, N>
where T: Empty

pub fn empty() -> Self pub fn is_empty(self) -> bool pub fn assert_empty<let S: u32>(self, msg: str<S>)

impl<let N: u32, T> Eq for ClaimedLengthArray<T, N>
where T: Eq

pub fn eq(self, other: Self) -> bool

impl<let N: u32, T> Serialize for ClaimedLengthArray<T, N>
where T: Serialize

pub fn serialize(self) -> [Field; N * <(resolved type) as Serialize>::N + 1]