# Residency

> USearch for Rust

Where the payload lives is the constructor's name, as in the C lifecycle verbs, so a residency an index lacks has no constructor to call.
Each takes only the placement its own hardware has, as memory domains, devices or paths with one shard per entry, and an empty list derives the placement: every NUMA node, one free device, or wherever the manifest points.

```rust
use std::path::Path;

let in_ram = DenseIndex::init_ram(&options, &[0, 1])?;               // one graph per socket
let in_vram = DenseIndex::init_vram(&options, &[0, 1, 2, 3])?;       // sharded, never replicated
let on_nvme = DenseIndex::view_nvme(DenseViewNvmeConfig {
    paths: &[Path::new("/mnt/nvme0")],                               // striped across the drives named
    ..DenseViewNvmeConfig::from("index.safegraphs")
})?;
```

An NVMe handle serves a checkpoint in place and is read-only, so every mutating verb fails on it with `Status::ReadOnly`.
Bigger indexes come from merging, never mutating: shards build in RAM, serialize, and join a manifest.

`use usearch::Residency;`

## Residency

Where an executor computes, and with it where the arenas it makes keep their memory.

```rust
pub enum Residency
```

- `Ram` = `1`: Volatile memory, traversed by CPU threads.
- `Vram` = `2`: Accelerator memory, traversed by GPU warps on a chosen device.
- `Nvme` = `3`: Persisted storage, traversed through pluggable I/O engines.

Implements: `Clone`, `Copy`, `StructuralPartialEq`, `PartialEq`, `Eq`, `Debug`, `Hash`, `Display`, `FromStr`

