> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct ClaimedLengthArray

Module: `protocol_types::utils::arrays`

```rust
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:

- Asserting all items to the LHS of the length are nonempty (dense).
- Asserting all items to the RHS of the length are empty.

## Fields

```rust
array: [T; N]
```

```rust
length: u32
```

## Implementations

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

```rust
pub fn assert_empty<let S: u32>(self, msg: str<S>)
```

```rust
pub fn assert_length_within_bounds<let S: u32>(self, msg: str<S>)
```

```rust
pub fn push(&mut self, item: T)
```

```rust
pub fn pop(&mut self) -> T
```

```rust
pub fn for_each<Env>(self, f: fn[Env](T))
```

```rust
pub fn for_each_i<Env>(self, f: fn[Env](T, u32))
```

```rust
pub fn from_bounded_vec(vec: BoundedVec<T, N>) -> Self
```

## Trait implementations

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

```rust
pub fn deserialize(
    fields: [Field; (N * <T as serde::serialization::Deserialize>::N) + 1],
) -> Self
```

```rust
pub fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self
```

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

```rust
pub fn empty() -> Self
```

```rust
pub fn is_empty(self: Self) -> bool
where
    Self: Eq
```

```rust
pub fn assert_empty<let S: u32>(self: Self, msg: str<S>)
where
    Self: Eq
```

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

```rust
pub fn eq(_self: Self, _other: Self) -> bool
```

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

```rust
pub fn serialize(self) -> [Field; (N * <T as serde::serialization::Serialize>::N) + 1]
```

```rust
pub fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>)
```
