1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//! RAII guard types that enforce the block lifecycle state machine.
//!
//! Every logical block in KVBM progresses through a fixed sequence of
//! states. The guard types in this module make those transitions explicit
//! at the type level: each transition consumes one guard and produces the
//! next. Dropping a guard at any point automatically returns the
//! underlying slot to the appropriate pool, so blocks are never leaked.
//!
//! # State machine
//!
//! ```text
//! stage / complete register_block
//! Reset ──────────────────────► Staged ─────────────────► Registered
//! ▲ │ │
//! │ reset │ │
//! ├──────────────────────────────┘ │
//! │ drop (reset + return) │
//! └─────────────────────────────────────────────────────────┘
//! ```
//!
//! # Public guard types
//!
//! - [`MutableBlock`] — `Reset` state.
//! - [`CompleteBlock`] — `Staged` state.
//! - [`ImmutableBlock`] — `Registered` state (cheap-to-clone strong handle).
//! - [`WeakBlock`] — non-owning reference to a registered block.
//!
//! Slot bookkeeping lives in [`BlockStore<T>`](crate::pools::BlockStore);
//! `Primary` vs `Duplicate` is captured by an internal flag on
//! [`ImmutableBlockInner`] and the corresponding slot state.
pub use CompleteBlock;
pub use ;
pub use MutableBlock;
pub use ;
pub use ImmutableBlockInner;
pub use crateBlockRegistrationHandle;
pub use crateBlockRegistry;
pub use crate::;
/// Marker trait for types that can serve as block-level metadata.
///
/// A blanket implementation covers every type that is `Clone + Send + Sync
/// + 'static`, so callers rarely need to think about this trait directly.
/// Error returned by block state transitions.
///
/// Every variant carries the originating block back to the caller so that
/// the block is never silently leaked on failure. The caller can inspect
/// the error, recover the block from the variant, and retry or drop it as
/// needed.
/// Controls whether the [`BlockRegistry`] accepts multiple physical blocks
/// that share the same [`SequenceHash`].
///
/// The policy is set once when a [`BlockManager`](crate::manager::BlockManager)
/// is built and applies to every subsequent registration.