grafos_locator/
lib.rs

1//! Typed locators and rendezvous/handoff records for fabric resource discovery.
2//!
3//! This crate provides two things:
4//!
5//! 1. **Locator types** — small, versioned structs that describe where a fabric
6//!    resource lives (memory region, block region, queue, RPC arena, replica set).
7//!    All locators are postcard-serializable and carry an explicit `version: u8`
8//!    field for forward compatibility.
9//!
10//! 2. **Handoff records** — a writer/reader pair backed by block storage
11//!    that lets a producer publish new locators with monotonically increasing
12//!    generations, and consumers detect changes by polling.
13//!
14//! # Locator types
15//!
16//! | Type | Describes |
17//! |------|-----------|
18//! | [`MemRegionLocator`](locator::MemRegionLocator) | Byte range within a memory lease |
19//! | [`BlockRegionLocator`](locator::BlockRegionLocator) | LBA range within a block lease |
20//! | [`QueueLocator`](locator::QueueLocator) | Ring buffer in a memory lease |
21//! | [`RpcArenaLocator`](locator::RpcArenaLocator) | Request/response arena pair |
22//! | [`ReplicaSetLocator`](locator::ReplicaSetLocator) | Set of memory replicas |
23//!
24//! # Handoff pattern
25//!
26//! ```text
27//! Writer                          Block Storage                     Reader
28//!   |                                  |                              |
29//!   |-- publish(new_locator) --------->|                              |
30//!   |   (bump generation, serialize)   |                              |
31//!   |                                  |<-------- poll() -------------|
32//!   |                                  |  (deserialize, check gen)    |
33//!   |                                  |--------- Some(state) ------->|
34//! ```
35//!
36//! # Feature flags
37//!
38//! | Feature | Default | Effect |
39//! |---------|---------|--------|
40//! | `std` | Yes | Enables `std` in grafos-std |
41//! | `sync-watch` | No | Adds `grafos-sync` watch channel integration |
42
43#![cfg_attr(not(feature = "std"), no_std)]
44
45extern crate alloc;
46
47pub mod handoff;
48pub mod locator;