Skip to main content

Module transition

Module transition 

Source
Expand description

Moving a row between states: the only writer of state, and the one place an edge is checked against CreditRegistrationState::allowed_targets.

Structs§

BatchMove
One row’s move in a transition_batch.
Transition

Enums§

AdminAttention
What a move does to the row’s admin-attention flag.
TransitionPolicy
Which (from → to) edges transition will write.
Transitioned
What transition_unless_moved_on did.

Functions§

check_edge 🔒
Refuses an edge outside the policy. The one place (from → to) legality is decided, for the single-row transition and the batched transition_batch alike.
lock_for_moves 🔒
The states of the named rows, locked until the caller’s transaction ends.
settle_pending_supersessions 🔒
Completes or abandons the pending supersessions of rows that were waiting on these attempts, as each attempt’s new state decides.
transition
Moves a ledger row to a new state and appends the matching audit event, atomically.
transition_batch
transition for a whole batch: one lock, one update, one insert of events, whatever the size.
transition_unless_moved_on
transition for a caller deciding from a snapshot another writer may have overtaken: a row no longer in expected_from_state comes back as Transitioned::MovedOn rather than as an error, since the row is now that writer’s and the caller carries on with the rest of its work.
write_moves 🔒
Writes already checked moves of locked rows, with their events, and returns the rows as written.