1mod client;
11mod error;
12mod liveness;
13mod server;
14pub mod session;
15pub use client::{CLIENT_DDL, ClientStore, INTENT_FLUSH_BATCH_SIZE, IntentRow, TaskRow};
16pub use error::{StoreError, StoreResult};
17pub use server::{
18 Append, CursorRow, EventRecord, FaultQuery, GhostSweepRow, LedgerRow, RoleRow, SERVER_DDL,
19 ServerFaultRow, ServerLedger, ServerSessionRow, SessionBindingRow, SessionWrite, rfc3339,
20};
21pub use session::{FaultRecord, SessionLedger, SessionRecord, VersionedSession};
22
23pub use onlyne_proto::LedgerState;
24
25pub fn transition_allowed(from: LedgerState, to: LedgerState) -> bool {
26 matches!(
27 (from, to),
28 (LedgerState::Queued, LedgerState::InFlight)
29 | (LedgerState::Queued, LedgerState::Rejected)
30 | (LedgerState::Queued, LedgerState::Expired)
31 | (LedgerState::InFlight, LedgerState::Acked)
32 | (LedgerState::InFlight, LedgerState::Queued)
33 | (LedgerState::InFlight, LedgerState::Rejected)
34 )
35}