---
title: "Supported data types"
description: "Supported native data types for the Aerospike Rust client and how values are mapped to database storage."
---

# Supported data types

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

The Aerospike Database supports these native types:

Click to view data types

-   Blob
-   Boolean
-   Bytes
-   Double
-   Float
-   GeoJSON
-   HyperLogLog
-   Integer
-   List
-   Map
-   OrderedMap
-   String

When setting a value in Rust, the Aerospike library automatically determines the best native Aerospike data type for storage:

-   Integers of all types up to and including `i64::MAX` are converted to 64-bit numerics.
-   `u64` values are not supported as record bin values and need to be casted to one of the other supported integer types. `u64` values can be stored as elements or keys in lists and maps.
-   Floating point values are stored in 64-bit IEEE-754 format.
-   Strings are stored as opaque byte arrays but de-serialized as UTF-8 strings when reading from the database.
-   Byte arrays are stored as blobs.

## Reading bin values

Bins in a `Record` are stored as `aerospike::Value`. To extract a typed Rust value, use `TryFrom` (or pattern match on the enum):

```rust
use aerospike::Value;

// Extract a string bin (returns None if the bin is missing or not a string)

let name: String = record

    .bins

    .get("name")

    .and_then(|v| String::try_from(v.clone()).ok())

    .unwrap_or_else(|| "unknown".to_string());

// Extract an integer bin

let age: i64 = record

    .bins

    .get("age")

    .and_then(|v| i64::try_from(v.clone()).ok())

    .unwrap_or(0);
```

Alternatively, match directly on the variant:

```rust
match record.bins.get("name") {

    Some(Value::String(s)) => s.clone(),

    _ => "unknown".to_string(),

}
```

::: note
`Value::as_string()` returns a **display** representation of any value (like `format!("{val}")`), not a typed string extraction. Do not chain `.ok()` on it; it returns `String`, not `Option`. Use `String::try_from(value.clone())` or match on `Value::String` instead.
:::