Skip to main content

PostgresStore

Struct PostgresStore 

Source
pub struct PostgresStore { /* private fields */ }
Expand description

A journal on PostgreSQL.

Implementations§

Source§

impl PostgresStore

Source

pub fn signing_as(self, signer: Arc<dyn Signer>) -> Self

Write records signed as this identity.

Off unless asked. The default is unsigned rather than self-signed: a plane that minted its own key would produce records that look attested and prove nothing.

Source

pub fn upcasting_with(self, upcaster: Arc<dyn Upcaster>) -> Self

Read records through this upcaster instead of the one this build ships.

The default is current_upcaster, which is what a deployment wants; another is for a reader that must lift shapes this build’s own does not.

Source

pub fn origin(self, origin: impl Into<String>) -> Self

Name this plane’s Merkle log.

Source

pub fn for_tenant(self, tenant: TenantId) -> Self

Serve one tenant.

The handle is the boundary: a store built for acme cannot name a globex run even holding a valid id, because the tenant is part of every key rather than a predicate someone remembers to add. The checkpoint origin carries the tenant too, so two tenants’ checkpoints are not mistaken for one plane’s — composed at read time from the base name and the tenant, never baked into a field. Baking it in made the builder order-sensitive: for_tenant called twice double-qualified the origin, and origin() after for_tenant silently dropped the tenant — either way a checkpoint under a name no verifier ever saw again.

Source§

impl PostgresStore

Source

pub async fn explain(&self, sql: &str) -> Result<String, StoreError>

The planner’s answer for a statement, as EXPLAIN lines.

Gated on testkit because it runs whatever SQL it is handed, which is a capability a production build has no reason to carry. It exists so a test can assert a plan rather than a duration: a stopwatch over an empty database passes whichever plan the query gets, which is the shape of check that cannot fail — and the defect it was written for was a sweep read whose answers were right and whose cost was the whole tenant.

§Errors

If the database cannot be reached or the statement does not plan.

Source

pub async fn erasure_probe(&self, scope: &str) -> Result<bool, StoreError>

A lifecycle lock for cryptographic memory erasure, in this database.

The coordinator that makes EncryptedMemoryStore honest on an active-active plane. Deliberately taken from the store rather than constructed from a connection string: a lock in a different database would be a second system that can be up while this one is down, and a coordinator that is available when the data is not protects nothing.

ⓘ
let memory = EncryptedMemoryStore::new(inner, keys, tenant)
    .coordinated_by(Arc::new(store.erasure_coordinator()));

Whether somebody is holding a scope’s erasure lock, without taking it.

pg_try_advisory_lock, released immediately if it was free — so this answers the question and leaves the answer true. For tests and operator diagnostics; the erasure path itself blocks rather than probing, because a caller that failed to get the lock would have to choose between retrying and skipping, and skipping an erasure is the wrong answer to contention.

§Errors

If the database cannot be reached.

Source

pub fn erasure_coordinator(&self) -> PostgresCoordinator

Source

pub async fn connect(url: &str) -> Result<Self, StoreError>

Connect and apply the schema.

§Errors

If the URL does not parse, the pool cannot be built, or the schema cannot be applied.

Source

pub async fn connect_sized( url: &str, max_connections: Option<usize>, ) -> Result<Self, StoreError>

connect, with an explicit connection ceiling.

The default ceiling is the pool’s own (CPU-derived), which is the right answer until it is not: a deployment sharing the database with other services sizes this deliberately, and a test proving behaviour under pool exhaustion needs a pool small enough to exhaust — the task-claim deadlock this crate shipped reproduced only where the pool was smaller than the racers, so every big development machine passed over it.

§Errors

As connect.

Trait Implementations§

Source§

impl AtomicJournal for PostgresStore

Source§

fn append_atomic<'life0, 'life1, 'async_trait>( &'life0 self, run: RunId, epoch: Epoch, work: &'life1 dyn AtomicWork, ) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run work and append what it returns, in one transaction, fenced by epoch exactly as an ordinary append is. Read more
Source§

impl AuthorityStore for PostgresStore

Source§

fn tenant(&self) -> &str

Which tenant this handle’s standing authorities belong to.
Source§

fn issue<'life0, 'life1, 'async_trait>( &'life0 self, authority: &'life1 StandingAuthority, ) -> Pin<Box<dyn Future<Output = Result<(), AuthorityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record a new authority. Read more
Source§

fn draw<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 AuthorityId, key: EffectKey, amount: Spend, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Drawn, AuthorityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Consume amount, or refuse and consume nothing. Read more
Source§

fn revoke<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 AuthorityId, reason: &'life2 str, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), AuthorityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Withdraw it. Idempotent; the first reason stands. Read more
Source§

fn state<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 AuthorityId, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthorityState>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

What this authority permitted and has consumed. Read more
Source§

impl BatchStore for PostgresStore

Source§

fn tenant(&self) -> &str

Which tenant this handle’s batches and item reservations belong to.
Source§

fn open<'life0, 'life1, 'async_trait>( &'life0 self, id: BatchId, plan_digest: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Register a batch. Idempotent on id, so a retried submission does not fork one act into two. Read more
Source§

fn plan_digest<'life0, 'async_trait>( &'life0 self, id: BatchId, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The plan digest this batch was opened with, or None for no such batch. Read more
Source§

fn mark_exhausted<'life0, 'async_trait>( &'life0 self, id: BatchId, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record that the source produced its last item. Read more
Source§

fn is_exhausted<'life0, 'async_trait>( &'life0 self, id: BatchId, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Whether the source has been read to the end.
Source§

fn reserve<'life0, 'life1, 'async_trait>( &'life0 self, batch: BatchId, key: &'life1 str, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<ItemRecord, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Claim an item and bind it to a run id, before the run starts. Read more
Source§

fn record<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: BatchId, key: &'life1 str, outcome: &'life2 ItemOutcome, spend: Spend, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record how an item ended, and what it consumed. Read more
Source§

fn cursor<'life0, 'async_trait>( &'life0 self, batch: BatchId, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The highest key whose item reached a terminal outcome, with no unfinished item before it. Read more
Source§

fn census<'life0, 'async_trait>( &'life0 self, batch: BatchId, ) -> Pin<Box<dyn Future<Output = Result<BatchCensus, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Counts by outcome, plus reserved-but-unfinished.
Source§

fn items<'life0, 'async_trait>( &'life0 self, batch: BatchId, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ItemRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every item record, oldest key first. For operators and for tests; the driver uses cursor and census.
Source§

fn items_needing_attention<'life0, 'async_trait>( &'life0 self, batch: BatchId, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ItemRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The items that are not settled, oldest key first. Read more
Source§

impl CaseStore for PostgresStore

Source§

fn tenant(&self) -> &str

Whose rows this handle can reach. Read more
Source§

fn correlate<'life0, 'life1, 'async_trait>( &'life0 self, keys: &'life1 [CorrelationKey], ) -> Pin<Box<dyn Future<Output = Result<Option<CaseId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find an open case matching any of these keys. Read more
Source§

fn correlate_or_open<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, kind: &'life1 str, keys: &'life2 [CorrelationKey], at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Correlation, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Correlate, or open a new case if nothing matched. Read more
Source§

fn case<'life0, 'async_trait>( &'life0 self, id: CaseId, ) -> Pin<Box<dyn Future<Output = Result<Option<Case>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch one case. Read more
Source§

fn cases<'life0, 'async_trait>( &'life0 self, after: Option<CaseId>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Case>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every case, one bounded page at a time, in stable id order. Read more
Source§

fn import_case<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, case: &'life1 Case, deadlines: &'life2 [Deadline], blobs: &'life3 [Digest], ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Write one complete case, exactly as given — an import authority, not a runtime path. Read more
Source§

fn attach_run<'life0, 'async_trait>( &'life0 self, case: CaseId, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record that a run touched this case.
Record that a case produced a blob. Read more
Source§

fn blobs_of<'life0, 'async_trait>( &'life0 self, case: CaseId, ) -> Pin<Box<dyn Future<Output = Result<Vec<Digest>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every blob this case produced, oldest first. Read more
Source§

fn put_state<'life0, 'async_trait>( &'life0 self, case: CaseId, expected: CaseVersion, state: Value, ) -> Pin<Box<dyn Future<Output = Result<CaseVersion, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Replace a case’s state, if it is still at expected. Read more
Source§

fn set_status<'life0, 'async_trait>( &'life0 self, case: CaseId, status: CaseStatus, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Move a case to a status. Read more
Source§

fn close<'life0, 'async_trait>( &'life0 self, case: CaseId, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close a case. Read more
Source§

fn register_deadline<'life0, 'life1, 'async_trait>( &'life0 self, d: &'life1 Deadline, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Register an obligation. The resolved instant is stored as given and never recomputed. Read more
Source§

fn deadlines<'life0, 'async_trait>( &'life0 self, case: CaseId, ) -> Pin<Box<dyn Future<Output = Result<Vec<Deadline>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn set_deadline_state<'life0, 'life1, 'async_trait>( &'life0 self, case: CaseId, name: &'life1 str, state: DeadlineState, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn breach_deadline<'life0, 'life1, 'async_trait>( &'life0 self, case: CaseId, name: &'life1 str, now: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Breach an obligation and escalate its case, in one transaction, if it is still outstanding and due at now. Returns whether it applied. Read more
Source§

fn due<'life0, 'async_trait>( &'life0 self, now: Timestamp, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Deadline>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Obligations that are due or approaching, oldest first. Read more
Source§

fn breaches_to_note<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Deadline>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Breaches breach_deadline applied whose account the sweep has not yet written, longest-overdue first.
Source§

fn mark_breach_noted<'life0, 'life1, 'async_trait>( &'life0 self, case: CaseId, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record that a breach’s account is on the journal. Idempotent. Read more
Source§

fn breached<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Deadline>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Missed obligations nobody has accounted for, longest-overdue first. Read more
Source§

fn acknowledge_breach<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, case: CaseId, name: &'life1 str, note: &'life2 BreachNote, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record that somebody has accounted for a breach. Read more
Source§

fn place_hold<'life0, 'life1, 'async_trait>( &'life0 self, case: CaseId, hold: &'life1 LegalHold, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Preserve this matter against every erasure verb until somebody lifts it. Read more
Source§

fn release_hold<'life0, 'async_trait>( &'life0 self, case: CaseId, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lift a hold, returning whether one was there to lift. Read more
Source§

fn release_hold_if<'life0, 'life1, 'async_trait>( &'life0 self, case: CaseId, standing: &'life1 LegalHold, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Lift the hold on case only if it is still standing — same instant, same reason, same operator. Read more
Source§

fn hold<'life0, 'async_trait>( &'life0 self, case: CaseId, ) -> Pin<Box<dyn Future<Output = Result<Option<LegalHold>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The hold on one matter, if it is held. Read more
Source§

fn holds<'life0, 'async_trait>( &'life0 self, after: Option<CaseId>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(CaseId, LegalHold)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every matter under hold, oldest hold first. Read more
Source§

fn by_status<'life0, 'async_trait>( &'life0 self, status: CaseStatus, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Case>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cases matching a status, newest first.
Source§

fn record_drill<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 DrillRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record what the last recovery rehearsal found. Read more
Source§

fn last_drill<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<DrillRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The last recovery rehearsal, or None if this plane has never run one. Read more
Source§

fn census<'life0, 'async_trait>( &'life0 self, now: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<CaseCensus, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

How much is open right now, for the gauges in runtime::metrics. Read more
Source§

impl Clone for PostgresStore

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PostgresStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DisclosureRegister for PostgresStore

Source§

fn record<'life0, 'life1, 'async_trait>( &'life0 self, act: &'life1 Disclosure, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Keep one act. Read more
Source§

fn disclosures<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, cases: &'life1 [CaseId], runs: &'life2 [RunId], ) -> Pin<Box<dyn Future<Output = Result<Vec<Disclosure>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Every act that carried any of cases or runs, oldest first. Read more
Source§

impl EventStore for PostgresStore

Source§

fn tenant(&self) -> &str

Whose rows this handle can reach. Read more
Source§

fn buffer<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 InboundEvent, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record an inbound event, returning false if this (source, id) was already seen. Read more
Source§

fn subscribe<'life0, 'life1, 'async_trait>( &'life0 self, sub: &'life1 Subscription, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Register a run’s interest in a future event.
Source§

fn claim_for<'life0, 'life1, 'async_trait>( &'life0 self, sub: &'life1 Subscription, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Option<BufferedEvent>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically find and claim a buffered event matching a subscription. Read more
Source§

fn match_waiter<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 InboundEvent, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Option<Subscription>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically find and claim a subscription matching an arrived event. Read more
Source§

fn deliver_to<'life0, 'life1, 'async_trait>( &'life0 self, target: RunId, event: &'life1 InboundEvent, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<TargetedDelivery, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically buffer event and claim it for the matching subscription of exactly run. Read more
Source§

fn unsubscribe<'life0, 'async_trait>( &'life0 self, run: RunId, effect: EffectKey, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Drop a subscription once it has been satisfied. Read more
Source§

fn unsubscribe_run<'life0, 'life1, 'async_trait>( &'life0 self, run: RunId, unanswered: &'life1 [EffectKey], ) -> Pin<Box<dyn Future<Output = Result<Retired, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Drop every subscription a run holds, and hand back what it held claimed for a wait it never answered. Read more
Source§

fn park_wait<'life0, 'life1, 'async_trait>( &'life0 self, sub: &'life1 Subscription, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Register a wait that already holds a claimed event, and mark it for redelivery. Read more
Source§

fn parked_waits<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Subscription>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits holding a claimed event nothing has delivered yet. Read more
Source§

fn erase_payload<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source: &'life1 str, id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove one buffered event’s payload while keeping its identity. Read more
Source§

fn minter<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source: &'life1 str, id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Minter>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Who minted the buffered event (source, id), or None when no such event was ever buffered. Read more
Source§

fn sweep_unclaimed<'life0, 'life1, 'async_trait>( &'life0 self, older_than: Timestamp, reason: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Move events nobody claimed within the window to the dead-letter list. Read more
Source§

fn dead_letters<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeadLetter>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Events that aged out unclaimed, newest first. Read more
Source§

fn waiting<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Subscription>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Runs currently waiting, for operational visibility.
Source§

impl JournalStore for PostgresStore

Source§

fn is_shared(&self) -> bool

The topology an embedded store cannot serve: several plane instances sharing one store, with fencing and exactly-once arbitrated by the database rather than by hoping the writers agree.

Source§

fn atomic(&self) -> Option<&dyn AtomicJournal>

This backend can. That is the whole reason the capability is a question rather than an assumption.

Source§

fn read_page<'life0, 'async_trait>( &'life0 self, run: RunId, from: Seq, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The bounded read, and the one that decodes — read is this with no ceiling, so the two cannot come to disagree about what a record is.

Source§

fn seals(&self) -> bool

Whether this store seals payloads on append, rewriting what it is handed. Read more
Source§

fn tenant(&self) -> &str

Whose rows this handle can reach. Read more
Source§

fn append<'life0, 'async_trait>( &'life0 self, epoch: Epoch, batch: Vec<Append>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append a batch, sealing each record into the chain. Read more
Source§

fn read<'life0, 'async_trait>( &'life0 self, run: RunId, from: Seq, ) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read a run’s records from from (inclusive, 1-based) onward. Read more
Source§

fn admitted_as<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<RunId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The run that holds this admission key, if one does. Read more
Source§

fn forget_admissions<'life0, 'async_trait>( &'life0 self, older_than: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retire admission keys claimed before older_than. Returns how many. Read more
Source§

fn count_by_outcome<'life0, 'life1, 'async_trait>( &'life0 self, outcome: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

How many runs currently rest on this conclusion. Read more
Source§

fn runs_by_outcome<'life0, 'life1, 'async_trait>( &'life0 self, outcome: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Concluded runs whose latest conclusion is outcome, newest first. Read more
Source§

fn runs_by_id<'life0, 'async_trait>( &'life0 self, after: Option<RunId>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every run this tenant holds records for, by run id ascending, one bounded page strictly after after. Read more
Source§

fn recent_runs<'life0, 'async_trait>( &'life0 self, after: Option<(u64, RunId)>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(RunId, u64)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Runs ordered by last durable append, newest first, one bounded page. Read more
Source§

fn recent_runs_from<'life0, 'life1, 'async_trait>( &'life0 self, source: &'life1 str, after: Option<(u64, RunId)>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(RunId, u64)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

recent_runs, narrowed to the runs one producer admitted: those whose RunAdmitted carries an admission key whose source half (origin_source) is source. Read more
Source§

fn case_history<'life0, 'async_trait>( &'life0 self, case: CaseId, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every record belonging to a case, oldest first. Read more
Source§

fn head<'life0, 'async_trait>( &'life0 self, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<Head, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The run’s current chain head.
Source§

fn acquire<'life0, 'life1, 'async_trait>( &'life0 self, run: RunId, owner: &'life1 str, ttl: Duration, ) -> Pin<Box<dyn Future<Output = Result<Lease, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Take ownership of a run, returning the fencing epoch to write under. Read more
Source§

fn renew<'life0, 'life1, 'async_trait>( &'life0 self, run: RunId, owner: &'life1 str, epoch: Epoch, ttl: Duration, ) -> Pin<Box<dyn Future<Output = Result<Lease, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Extend a lease this caller still holds, without ever claiming one. Read more
Source§

fn waiting_runs<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<WaitingRun>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The runs that are waiting, and what each one waits for. Read more
Source§

fn abandoned_runs<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Runs whose lease expired without being released — the runs an instance died holding. Read more
Source§

fn release_lease<'life0, 'async_trait>( &'life0 self, run: RunId, epoch: Epoch, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Hand a lease back, so the next instance need not wait out the TTL. Read more
Source§

fn seal<'life0, 'life1, 'async_trait>( &'life0 self, run: RunId, epoch: Epoch, outcome: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Digest, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Close the chain and return its terminal hash — what a signature covers. Read more
Source§

fn checkpoint<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Checkpoint, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A commitment to the set of sealed runs. Read more
Source§

fn consistency_proof<'life0, 'async_trait>( &'life0 self, old_size: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<Digest>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prove the log has only grown since a checkpoint of old_size. Read more
Source§

fn inclusion_proof<'life0, 'async_trait>( &'life0 self, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<Option<Inclusion>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prove a sealed run is in the log this checkpoint commits to. Read more
Source§

fn inclusion_proof_at<'life0, 'async_trait>( &'life0 self, run: RunId, size: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Inclusion>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prove a sealed run is in the log as it stood at size leaves — the checkpoint an earlier checkpoint returned, not the live one. Read more
Source§

fn log_positions<'life0, 'life1, 'async_trait>( &'life0 self, runs: &'life1 [RunId], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<(u64, Digest)>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Where each of runs sits in the log — its index and leaf — or None for a run that is not sealed, in the order asked. Read more
Source§

fn request_cancel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run: RunId, actor: &'life1 Operator, reason: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Ask a run to stop, durably. Read more
Source§

fn cancellation<'life0, 'async_trait>( &'life0 self, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<Option<Cancellation>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The pending stop request for a run, if one was made. Read more
Source§

fn verify<'life0, 'async_trait>( &'life0 self, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<Digest, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Verify a run’s chain end to end.
Source§

impl MemoryStore for PostgresStore

Source§

fn tenant(&self) -> &str

Whose rows this handle can reach. Read more
Source§

fn seals(&self) -> bool

Whether this store seals payloads, and so runs a subject erasure of its own beneath any wrapper the plane adds. Read more
Source§

fn remember<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 MemoryItem, ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Append a new version of a memory. Read more
Source§

fn recall<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 Recall, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The current versions matching a query — most trusted first, then newest, then id, globally across purposes (see Recall for why the ordering is contractual). Read more
Source§

fn version<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, version: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<MemoryItem>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

One exact version, superseded or not. Read more
Source§

fn current<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, as_of: Option<Timestamp>, ) -> Pin<Box<dyn Future<Output = Result<Option<MemoryItem>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The one version of id a fresh recall at as_of would be allowed to see — or None, which covers a memory that was never written, was forgotten or swept, or whose effective expiry (min(expires_at, access window)) has passed the cutoff. None for as_of skips the expiry check, exactly as it does on recall. Read more
Source§

fn subject_ids<'life0, 'life1, 'async_trait>( &'life0 self, subject: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Every id currently belonging to a subject — the erasure path’s enumeration. Read more
Source§

fn forget<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Forget a memory and every version of it. Read more
Source§

fn forget_cascading<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Cascade, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Forget a memory and everything derived from it, transitively. Read more
Source§

fn forget_subject<'life0, 'life1, 'async_trait>( &'life0 self, subject: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Forget everything about a subject. Read more
Place or release a legal hold. A held id cannot be forgotten, swept, or removed as part of subject/cascading erasure: those refuse with StoreError::UnderLegalHold, and the sweep passes over it.
Source§

fn legal_holds<'life0, 'life1, 'async_trait>( &'life0 self, after: Option<&'life1 str>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Every held id, in id order, starting after after. Read more
Source§

fn legal_hold<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Whether an id is currently protected by legal hold.
Source§

fn sweep_expired<'life0, 'async_trait>( &'life0 self, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, u64)>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Atomically erase current memories whose effective expiry has passed, unless held. Returns the ids erased, each with the highest version it held — what a sealing wrapper needs to destroy every version’s key. Read more
Source§

fn touch<'life0, 'life1, 'async_trait>( &'life0 self, ids: &'life1 [String], at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Refresh sliding access retention for current ids at a journaled instant. Read more
Source§

fn derivatives<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Memories derived from this one, directly. Read more
Source§

fn erasure_is_distributed(&self) -> Option<bool>

Whether this store’s erasure lifecycle lock spans instances. Read more
Source§

fn erasure_index(&self) -> Option<Arc<dyn SemanticRetriever>>

The semantic index every erasure through this handle reaches — a sealing layer’s own subject erasure included. Read more
Source§

impl PushStore for PostgresStore

Source§

fn tenant(&self) -> &str

Whose rows this handle can reach. Read more
Source§

fn put<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 PushConfig, next_seq: Seq, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Register or replace a configuration. Read more
Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, task: RunId, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<PushConfig>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

One configuration. Read more
Source§

fn list<'life0, 'async_trait>( &'life0 self, task: RunId, ) -> Pin<Box<dyn Future<Output = Result<Vec<PushConfig>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every configuration for a task. Read more
Source§

fn due<'life0, 'async_trait>( &'life0 self, at: u64, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<PushRegistration>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Registrations whose retry instant has arrived, in stable order. Read more
Source§

fn due_in<'life0, 'async_trait>( &'life0 self, at: u64, limit: usize, namespace: PushNamespace, ) -> Pin<Box<dyn Future<Output = Result<DueBatch, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The due registrations of one namespace, however deep in the stable order they sit — plus a count of the other namespace’s due rows. Read more
Source§

fn advance<'life0, 'life1, 'async_trait>( &'life0 self, task: RunId, id: &'life1 str, next_seq: Seq, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Acknowledge every record before next_seq.
Source§

fn retry<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: RunId, id: &'life1 str, next_attempt_at: u64, error: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record a failed attempt without advancing the cursor. Read more
Source§

fn park<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: RunId, id: &'life1 str, error: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Stop delivering to this registration, and keep its cursor. Read more
Source§

fn parked<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<PushRegistration>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Parked registrations, in the store’s stable order. Read more
Source§

fn unpark<'life0, 'life1, 'async_trait>( &'life0 self, task: RunId, id: &'life1 str, at: u64, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Re-arm a parked registration: due at at, with its attempt count reset. Read more
Source§

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, task: RunId, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Forget one. Idempotent. Read more
Source§

impl QuotaStore for PostgresStore

Source§

fn tenant(&self) -> &str

Which tenant this handle accounts for. Read more
Source§

fn reserve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run: RunId, quota: &'life1 TenantQuota, hold: Option<&'life2 SpendHold>, at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), QuotaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Take a concurrency slot for run, and hold its spend, or refuse. Read more
Source§

fn reserve_rate<'life0, 'life1, 'async_trait>( &'life0 self, reservation: &'life1 RateReservation, ) -> Pin<Box<dyn Future<Output = Result<(), QuotaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Take room for one dispatch under its tool’s rate ceilings, or refuse. Read more
Source§

fn rate_room<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, grant: &'life1 str, ceilings: &'life2 [RateCeiling], at: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), QuotaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Whether a dispatch of grant would have room now, taking none. Read more
Source§

fn set_halt<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, scope: &'life1 HaltScope, by: &'life2 Operator, at: Timestamp, reason: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Stop work at scope from starting. Read more
Source§

fn lift_halt<'life0, 'life1, 'async_trait>( &'life0 self, scope: &'life1 HaltScope, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Let work at scope start again. Read more
Source§

fn lift_halt_if<'life0, 'life1, 'async_trait>( &'life0 self, standing: &'life1 Halt, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Lift the halt at standing.scope only if the row there is still standing — same reason, same operator, same instant. Read more
Source§

fn halts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Halt>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every standing halt for this tenant. Read more
Source§

fn release<'life0, 'async_trait>( &'life0 self, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Give back, idempotently, the slot and the spend hold of an admission whose journal never landed, or of a run that concluded with no pass to settle. Read more
Source§

fn carry<'life0, 'life1, 'async_trait>( &'life0 self, run: RunId, period: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Move a run’s spend hold into period, where a resume is about to spend. Read more
Source§

fn reservations<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Held>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every run holding spend against this tenant’s periods, by run id. Read more
Source§

fn reserved<'life0, 'life1, 'async_trait>( &'life0 self, period: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Spend, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

What open runs hold against period. Read more
Source§

fn settle<'life0, 'life1, 'async_trait>( &'life0 self, settlement: &'life1 QuotaSettlement, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Settle one live pass exactly once. Read more
Source§

fn spent<'life0, 'life1, 'async_trait>( &'life0 self, period: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Spend, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

What this tenant has settled in period — spend that happened, not spend held. Read more
Source§

fn running<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u32, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

How many runs this tenant has executing. Read more
Source§

fn running_runs<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<RunId>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Which runs hold this tenant’s slots. Read more
Source§

impl Registry for PostgresStore

Source§

fn publish<'life0, 'life1, 'async_trait>( &'life0 self, manifest: &'life1 Manifest, ) -> Pin<Box<dyn Future<Output = Result<Digest, RegistryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Publish a manifest under its own name and version. Read more
Source§

fn publish_signed<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, manifest: &'life1 Manifest, signer: &'life2 dyn Signer, ) -> Pin<Box<dyn Future<Output = Result<Digest, RegistryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Publish, and record who says so. Read more
Source§

fn resolve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, version: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Manifest, RegistryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Resolve a name and version to whatever the registry currently holds. Read more
Source§

fn resolve_verified<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, name: &'life1 str, version: &'life2 str, verifier: &'life3 dyn Verifier, ) -> Pin<Box<dyn Future<Output = Result<(Manifest, KeyId), RegistryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Resolve, and refuse anything this verifier will not vouch for. Read more
Source§

fn versions<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, RegistryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Every published version of a name, in the registry’s order. Read more
Source§

fn names<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, RegistryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every name this registry holds, sorted. Read more
Source§

fn resolve_pinned<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, version: &'life2 str, expected: Digest, ) -> Pin<Box<dyn Future<Output = Result<Manifest, RegistryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Resolve, and refuse anything but the digest the caller expects. Read more
Source§

impl TaskStore for PostgresStore

Source§

fn tenant(&self) -> &str

Whose rows this handle can reach. Read more
Source§

fn open<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task, ) -> Pin<Box<dyn Future<Output = Result<Task, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a task, or return the existing one with this id. Read more
Source§

fn task<'life0, 'async_trait>( &'life0 self, id: TaskId, ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch one task. Named for what it returns — see CaseStore::case.
Source§

fn claim<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: TaskId, actor: &'life1 str, roles: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Task, ClaimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Reserve a task for one actor. Read more
Source§

fn take_over<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: TaskId, from: &'life1 str, actor: &'life2 str, roles: &'life3 [String], ) -> Pin<Box<dyn Future<Output = Result<Task, ClaimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Take a claim over from a holder who is not coming back. Read more
Source§

fn release<'life0, 'life1, 'async_trait>( &'life0 self, id: TaskId, actor: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ClaimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Release a claim without deciding. Read more
Source§

fn set_state<'life0, 'async_trait>( &'life0 self, id: TaskId, state: TaskState, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Settle a pending task, returning whether this call settled it. Read more
Source§

fn withdraw_run<'life0, 'life1, 'async_trait>( &'life0 self, run: RunId, awaited: &'life1 [TaskId], ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Withdraw the tasks in awaited that belong to run and are still pending, returning how many. Read more
Source§

fn escalate<'life0, 'async_trait>( &'life0 self, id: TaskId, ) -> Pin<Box<dyn Future<Output = Result<Task, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Widen an unanswered task to its declared escalation audience. Read more
Source§

fn queue<'life0, 'life1, 'async_trait>( &'life0 self, roles: &'life1 [String], limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Open work, highest priority and oldest first.
Source§

fn for_case<'life0, 'async_trait>( &'life0 self, case: CaseId, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Everything pending on one matter.
Source§

fn open_count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

How many decisions are waiting on a person, across every role. Read more
Source§

fn overdue<'life0, 'async_trait>( &'life0 self, now: Timestamp, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Tasks whose window has closed and whose expiry policy has not yet fired. Read more
Source§

impl TimerStore for PostgresStore

Source§

fn tenant(&self) -> &str

Which tenant this handle’s wake-up rows belong to.
Source§

fn arm<'life0, 'life1, 'async_trait>( &'life0 self, timer: &'life1 Timer, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Register a run’s wake-up. Read more
Source§

fn claim_due<'life0, 'async_trait>( &'life0 self, now: Timestamp, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Timer>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Atomically claim timers due at or before now. Read more
Source§

fn pending_count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

How many runs are sleeping, for the gauge. Read more
Source§

fn disarm<'life0, 'async_trait>( &'life0 self, run: RunId, effect: EffectKey, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retire a fired timer.
Source§

fn disarm_run<'life0, 'async_trait>( &'life0 self, run: RunId, ) -> Pin<Box<dyn Future<Output = Result<usize, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retire every timer a run still has armed, returning how many. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<B> FullBackend for B

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more