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

# decode_with_fast_schema

> decode_with_fast_schema — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[avro](https://docs.kinetica.com/content/api/rust/avro/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/avro.rs#L489-L494)&#x20;

<pre>`pub fn decode_with_fast_schema<T: DeserializeOwned + Send, B: AsRef<[u8]> + Sync>(    schema: &Schema,    binary_records: &[B],) -> Result<Vec<T>, KineticaError>`</pre>

Decodes binary Avro records using a pre-parsed serde\_avro\_fast schema.This is equivalent to `decode_records` but accepts the schema by reference. Useful when decoding multiple batches with the same schema to avoid repeated schema parsing.

## Example

```rust theme={null}
let schema = parse_fast_schema(&response.type_schema)?;

// Decode multiple batches without re-parsing schema
for batch in batches {
    let records: Vec<MyRecord> = decode_with_fast_schema(&schema, &batch)?;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.