# Struct framing::Reassembler

> Per-connection reassembly state machine.

`zaun_community_protocol::framing::Reassembler` · Struct

```rust
pub struct Reassembler { … }
```

Per-connection reassembly state machine.

## Methods

### `new`

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

A reassembler with the protocol's `max_frame` (`MAX_FRAME`).

### `with_max_frame`

```rust
pub fn with_max_frame(max_frame: usize) -> Self
```

A reassembler with a stricter host `max_frame`; never above `MAX_FRAME`.

### `expire`

```rust
pub fn expire(&mut self, now_ms: u64) -> usize
```

Discards reassemblies whose first fragment arrived more than 60 s before `now_ms`
(exactly 60 s is still accepted). Returns how many were discarded.

### `push`

```rust
pub fn push(&mut self, fragment: Fragment<'_>, now_ms: u64) -> Pushed
```

Pushes one fragment received at `now_ms`. Expired reassemblies are discarded first.

### `open_count`

```rust
pub fn open_count(&self) -> usize
```

Number of open reassemblies (≤ `MAX_OPEN_REASSEMBLIES`).

### `buffered_bytes`

```rust
pub fn buffered_bytes(&self) -> usize
```

Chunk bytes currently buffered (≤ `MAX_OPEN_REASSEMBLIES × max_frame`).

## Trait implementations

`Debug`, `Default`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/framing/reassembly/struct.Reassembler.html)
