> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Gateway Client Protocol • Rust AI Agent SDK

> GatewayClientProtocol: Protocol for gateway client connections. Clients are external connections (WebSocket, HTTP, etc.) that communicate with agents through the gateway.

# GatewayClientProtocol

> Defined in the [**gateway**](../modules/gateway) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Protocol for gateway client connections. Clients are external connections (WebSocket, HTTP, etc.) that communicate with agents through the gateway.

## Methods

### `client_id`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn client_id(&self) -> &str
```

Unique client identifier.

### `is_connected`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn is_connected(&self) -> bool
```

Whether the client is currently connected.

### `connected_at`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn connected_at(&self) -> f64
```

Connection timestamp.

### `send`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn send(&self, event: GatewayEvent) -> Result<()>
```

Send an event to the client.

**Parameters:**

| Name    | Type           |
| ------- | -------------- |
| `event` | `GatewayEvent` |

### `receive`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn receive(&self) -> Result<GatewayEvent>
```

Receive an event from the client.

### `close`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn close(&self) -> Result<()>
```

Close the client connection.

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/gateway/mod.rs">
  `praisonai/src/gateway/mod.rs` at line 0
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust CLI" icon="terminal" href="/docs/rust/cli" />

  <Card title="Rust Quickstart" icon="rocket" href="/docs/rust/quickstart" />

  <Card title="Rust Gateway" icon="tower-broadcast" href="/docs/rust/gateway" />
</CardGroup>
