# Enum encoding::DecodeError

> The input is not a canonical encoding.

`zaun_community_protocol::encoding::DecodeError` · Enum

```rust
pub enum DecodeError { … }
```

The input is not a canonical encoding.

## Variants

### `Truncated { needed, remaining }`

A fixed field, length or count needs more bytes than remain.

### `TrailingBytes(usize)`

Bytes after the top-level object.

### `InvalidBool(u8)`

A `bool` byte other than `0x00` or `0x01`.

### `InvalidOptionTag(u8)`

An `option` tag other than `0x00` or `0x01`.

### `OverLimit { len, max }`

A length or count above the field's limit.

### `InvalidUtf8`

A `string` that is not valid UTF-8.

### `UnknownFormat(u8)`

An unknown `format` byte.

### `UnknownSuite(u8)`

An unknown `suite` byte (`0x00`, `0x02`–`0xFF`).

### `Invalid(&'static str)`

A field breaks a rule of its object (the field name).

## Trait implementations

`Clone`, `Copy`, `Debug`, `Display`, `Eq`, `Error`, `From<DecodeError>`, `PartialEq`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/encoding/error/enum.DecodeError.html)
