# Keys

> USearch for Rust

A `Key` is a 128-bit identity, rendered as a lowercase dashed UUID.
Integer identities park in the low eight bytes, so `Key::from(42u64)` prints as `00000000-0000-0000-0000-00000000002a`.

```rust
let key = Key::from(42u64);
let wide = Key::from(0x0123_4567_89ab_cdef_0123_4567_89ab_cdefu128);
let parsed: Key = "00000000-0000-0000-0000-00000000002a".parse()?;
assert_eq!(u64::try_from(parsed), Ok(42));                // refused when the high eight bytes are set
assert_eq!(u128::from(wide), 0x0123_4567_89ab_cdef_0123_4567_89ab_cdef);
```

Keys need not be unique: an index admits up to `values_per_key` entries under one, `count` reports how many it holds, and `get` returns them all.
`Key::NIL` is the all-zero key.

`use usearch::Key;`

## Key

A 128-bit entry identity, rendered as a lowercase dashed UUID.

```rust
pub struct Key(pub [u8; 16]);
```

Keys need not be unique: several entries may share one, and [`count`](https://www.unum.cloud/docs/usearch/rust/metrics.md#count) reports how many.
Integer identities park in the low eight bytes, so `Key::from(42u64)` prints as
`00000000-0000-0000-0000-00000000002a`.

- `0` `[u8; 16]`: The sixteen identity bytes, most significant first.

Implements: `Clone`, `Copy`, `Default`, `StructuralPartialEq`, `PartialEq`, `Eq`, `PartialOrd`, `Ord`, `Hash`, `From<u64>`, `From<u128>`, `From<[Key](#Key)>`, `TryFrom<[Key](#Key)>`, `FromStr`, `Display`, `Debug`

## NIL

The all-zero key.

```rust
pub const NIL: Key = _;
```

