Available languages: [Python](https://databento.com/docs/api-live/client/close.python.md) · [C++](https://databento.com/docs/api-live/client/close.cpp.md) · [Rust](https://databento.com/docs/api-live/client/close.rust.md) · [Raw](https://databento.com/docs/api-live/client/close.raw.md)

Source: https://databento.com/docs/api-live/client/close


### LiveClient::close

Stop the session.
The instance can be reused by calling [Live.reconnect](https://databento.com/docs/api-live/client/reconnect.md).

#### API method

```rust
pub async fn close(&mut self) -> databento::Result<()>;
```

#### Example usage

```rust
use databento::{
    LiveClient,
    dbn::{Dataset::GlbxMdp3, SType, Schema},
    live::Subscription,
};

// Create a live client
let mut client = LiveClient::builder()
    .key("$YOUR_API_KEY")?
    .dataset(GlbxMdp3)
    .build()
    .await?;
// Subscribe to the trades schema for all ES futures
client
    .subscribe(
        Subscription::builder()
            .schema(Schema::Trades)
            .stype_in(SType::Parent)
            .symbols("ES.FUT")
            .build(),
    )
    .await?;
// Start the streaming session
client.start().await?;
// Close the streaming session
client.close().await?;
```
