Available languages: [Python](https://databento.com/docs/api-historical/helpers/dbn-store-with-zstd.python.md) · [C++](https://databento.com/docs/api-historical/helpers/dbn-store-with-zstd.cpp.md) · [Rust](https://databento.com/docs/api-historical/helpers/dbn-store-with-zstd.rust.md) · [HTTP](https://databento.com/docs/api-historical/helpers/dbn-store-with-zstd.http.md)

Source: https://databento.com/docs/api-historical/helpers/dbn-store-with-zstd


### AsyncDbnStore::with_zstd

Create a new decoder from a Zstandard-compressed DBN stream that implements [AsyncReadExt](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html).
If `reader` implements [AsyncBufRead](https://docs.rs/tokio/latest/tokio/io/trait.AsyncBufRead.html), it's better to use [with_zstd_buffer](https://databento.com/docs/api-historical/helpers/dbn-store-with-zstd-buffer.md) to avoid unnecessary additional buffering.

#### API method

```rust
pub async fn with_zstd<R>(mut reader: R) -> dbn::Result<Self>
where
    R: tokio::io::AsyncReadExt + Unpin;
```

#### Parameters

| Parameter | Type | Description |
| `reader` | R: tokio::io::AsyncReadExt + Unpin | A readable Zstandard-compressed DBN byte stream. |

#### Returns

An [AsyncDbnStore](https://databento.com/docs/api-historical/helpers/dbn-store.md) object.

This function will return an error if it is unable to parse the metadata in `reader` or the input is encoded in a newer version of DBN.
