Skip to main content

nodedb_lite/sync/array/inbound/
outcome.rs

1//! [`InboundOutcome`] — return type for every [`super::ArrayInbound`]
2//! dispatcher method.
3
4use nodedb_array::sync::apply::ApplyRejection;
5
6/// Outcome returned by each [`super::ArrayInbound`] handler.
7#[derive(Debug, Clone, PartialEq)]
8pub enum InboundOutcome {
9    /// The op was applied to local engine state.
10    Applied,
11    /// The op was already present; no state was changed (idempotent replay).
12    Idempotent,
13    /// The op was rejected by the local apply engine.
14    Rejected(ApplyRejection),
15    /// A snapshot chunk was buffered; more chunks are expected.
16    SnapshotPartial {
17        /// Number of chunks received so far (including this one).
18        received: u32,
19        /// Total chunks declared in the snapshot header.
20        total: u32,
21    },
22    /// A snapshot was fully assembled and all contained ops applied.
23    SnapshotApplied {
24        /// Number of ops applied from the assembled snapshot.
25        ops_applied: u64,
26    },
27    /// A schema CRDT snapshot was imported into the local registry.
28    SchemaImported,
29    /// A reject message was processed and the offending op removed from the
30    /// pending queue.
31    RejectAcknowledged,
32}