# Struct envelope::EventEnvelope

> `{ "v", "type", "community_id", "channel_id"?, "stream", "sequence"?, "timestamp", "actor_id", "body" }`. Deserialisation validates with `EventEnvelope::validate`.

`zaun_community_protocol::envelope::EventEnvelope` · Struct

```rust
pub struct EventEnvelope { … }
```

`{ "v", "type", "community_id", "channel_id"?, "stream", "sequence"?, "timestamp",
"actor_id", "body" }`. Deserialisation validates with `EventEnvelope::validate`.

## Fields

### `v: u16`

Envelope version.

### `kind: String`

Event name.

### `community_id: CommunityId`

The community.

### `channel_id: Option<ChannelId>`

Present for channel-stream and channel-related member-stream events.

### `stream: Stream`

The stream.

### `sequence: Option<u64>`

`channel_seq` or `member_seq`; absent on the live stream.

### `timestamp: u64`

Host time of acceptance, ms since the Unix epoch.

### `actor_id: Option<MemberId>`

The member who caused the event; `null` for host-initiated events.

### `body: Box<RawValue>`

The event body object.

## Methods

### `validate`

```rust
pub fn validate(&self) -> Result<(), EventError>
```

Checks the the protocol rules: `sequence` present on channel/member streams and absent on live,
`channel_id` on the channel stream, integers below `2^53`, an object body.

# Errors
The first rule broken.

## Trait implementations

`Clone`, `Debug`, `Deserialize<'de>`, `Serialize`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/envelope/event_envelope/struct.EventEnvelope.html)
