Skip to main content

oxide_batch_repository/
lib.rs

1//! Internal implementation crate for `OxideBatch`.
2//!
3//! **This crate is implementation detail. Use
4//! [`oxide-batch`](https://crates.io/crates/oxide-batch) instead.**
5//!
6//! It exists on crates.io only because the published `oxide-batch` facade
7//! depends on it. Its API carries no stability promise: items may be added,
8//! changed, or removed in any release, without a deprecation period. It has no
9//! supported-configuration matrix, no compatibility ledger row, and no
10//! independent release cadence.
11//!
12//! Everything here that `OxideBatch` supports is re-exported from `oxide-batch`
13//! under a stable path.
14//!
15//! The crate holds the metadata repository, unit-of-work, clock, identifier,
16//! explorer, operator, retention, and recovery ports, the durable partition,
17//! flow-decision, audit, retention, and recovery values those ports exchange,
18//! the bounded operator request envelope, and the keyset pagination vocabulary
19//! the explorer port pages with. It depends on no async runtime, database
20//! driver, command-line framework, telemetry SDK, broker client, or web
21//! framework, and on no `OxideBatch` crate other than `oxide-batch-core`.
22//!
23//! Metadata adapters, the services that drive these ports, and the execution
24//! engines live above this crate. The plan compiler is an independent sibling
25//! in `oxide-batch-plan`, which this crate may not depend on.
26//!
27//! # Items marked `#[doc(hidden)]`
28//!
29//! Some items exist as `#[doc(hidden)] pub` only because the facade's own code
30//! was split from these types by the extraction boundary: private access that
31//! one crate resolved by module privacy now crosses a crate boundary. They are
32//! not part of any surface, supported or otherwise, and the facade never
33//! re-exports one under its own name. The staged crate-extraction contract
34//! records each one.
35
36#![forbid(unsafe_code)]
37
38mod explorer;
39mod flow;
40mod operator;
41mod partition;
42mod recovery;
43mod repository;
44mod request;
45mod retention;
46
47pub use explorer::{
48    Cursor, CursorError, CursorKey, DEFAULT_PAGE_SIZE, DefinitionDescriptor, ExplorerError,
49    ExplorerQuery, ExplorerRepository, JobExecutionProjection, JobInstanceProjection,
50    MAX_CURSOR_BYTES, MAX_PAGE_SIZE, MAX_RESPONSE_BYTES, MIN_UNRESOLVED_AGE, Page, PageRequest,
51    PageSize, ParameterDescriptor, QueryWindow, StateEnvelopeDescriptor, StepExecutionProjection,
52    StepPartitionProjection,
53};
54pub use explorer::{ExplorerRow, page, resume_window, start_window};
55pub use flow::{
56    FlowDecision, FlowDecisionId, FlowDecisionRequest, FlowDecisionSequence, FlowStepState,
57    FlowTransitionKind,
58};
59pub use operator::{
60    OperatorOutcomeClass, OperatorRecord, OperatorRecordDraft, OperatorRejection, OperatorRequest,
61    RecoveryDirective,
62};
63pub use partition::PartitionMutationError;
64pub use partition::{
65    MAX_PARTITION_CONTEXT_BYTES, MAX_PARTITION_KEY_BYTES, PartitionAggregate,
66    PartitionAggregationError, PartitionKey, PartitionPlanEntry, PartitionResult,
67    PartitionValueError, StepPartition, aggregate_step_partitions,
68};
69pub use recovery::{
70    DEFAULT_MAX_CLOCK_SKEW, DEFAULT_STALE_THRESHOLD, MAX_CLOCK_SKEW, MAX_STALE_THRESHOLD,
71    MIN_CLOCK_SKEW, MIN_STALE_THRESHOLD, MaxClockSkew, MonotonicClock, MonotonicInstant,
72    OwnerObservation, OwnerToken, RecoveryError, RecoveryEvidence, RecoveryMarkers,
73    RecoveryProposal, RecoveryRepository, RecoverySnapshot, RecoveryStepEvidence, StaleThreshold,
74    SystemMonotonicClock,
75};
76pub use repository::{
77    BoxFuture, Clock, ExecutionControl, IdGenerationError, IdGenerator, JobInstanceSelection,
78    JobRepository, RecoveryDecision, RecoveryDisposition, RecoveryField, RecoveryRequest,
79    RecoveryRequestError, RecoveryResult, RepositoryCapability, RepositoryDescriptor,
80    RepositoryError, RepositoryUnitOfWork, SequentialIdGenerator, SystemClock,
81};
82pub use repository::{aggregate_partition_parent, map_partition_aggregation, recovered_execution};
83pub use request::hex_digest;
84pub use request::{
85    ActorRef, AuthorizationClass, MAX_ACTOR_REF_BYTES, MAX_OPERATION_ID_BYTES,
86    MAX_REASON_CODE_BYTES, OperationId, OperatorAction, ReasonCode, RequestDigest, RequestField,
87    RequestFieldError,
88};
89pub(crate) use request::{CanonicalWriter, RequestArguments, request_digest};
90pub use retention::{
91    DEFAULT_PURGE_AGE, MAX_PURGE_BATCH, MIN_PURGE_AGE, PurgeBatchBound, PurgeCandidate,
92    PurgeCounts, PurgePlan, PurgePlanRequest, PurgeSurvey, RetentionAction, RetentionError,
93    RetentionHold, RetentionOutcome, RetentionRecord, RetentionRecordDraft, TerminalStatusSet,
94};