# Enum envelope::BatchError

> A batch that breaks the rules of the protocol Indices count from 0 in `body.events`.

`zaun_community_protocol::envelope::BatchError` · Enum

```rust
pub enum BatchError { … }
```

A batch that breaks the rules of the protocol Indices count from 0 in `body.events`.

## Variants

### `Malformed`

Not JSON, not an object, `type` is not `events`, or `body.events` is missing.

### `Element(usize)`

An element is not a valid the protocol event envelope.

### `Nested(usize)`

An element is itself a batch or a response; batches do not nest.

### `Mismatch(usize)`

An element's `community_id` or `v` differs from the batch's.

## Trait implementations

`Clone`, `Copy`, `Debug`, `Display`, `Eq`, `Error`, `PartialEq`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/envelope/events_batch/enum.BatchError.html)
