kvbm_common/lib.rs
1// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use serde::{Deserialize, Serialize};
5
6pub type BlockId = usize;
7pub type SequenceHash = dynamo_tokens::PositionalLineageHash;
8
9pub use dynamo_tokens as tokens;
10
11/// Logical layout handle type encoding the layout ID.
12///
13/// KVBM manages G1, G2 and G3 layouts directly. G4 is managed by an external service.
14#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
15pub enum LogicalLayoutHandle {
16 /// Representation of GPU / Device Memory
17 /// G1 is fixed sized and managed by either the framework or the local instance of KVBM.
18 G1,
19 /// Representation of CPU / Host Memory
20 /// G2 is fixed sized and managed by the local instance of KVBM.
21 G2,
22 /// Representation of Disk Storage (Local or AttachedStorage)
23 /// G3 is fixed sized and managed by the local instance of KVBM.
24 G3,
25 /// Representation of Blocks held in an external service
26 /// outside the control of the KVBM system.
27 G4,
28}