Skip to main content

Crate rustev_runtime

Crate rustev_runtime 

Source
Expand description

Rustev’s runtime (spec 003).

Drives the pure core’s staged evaluation through DecisionBackends under explicit bounds: a monotonic Clock and one end-to-end deadline, bounded admission and concurrency, cost Ledgers that reserve before dispatch, retries and fallback only as the plan’s execution policy declares them, cancellation that records exactly what the backend acknowledged, and a run record delivered under a SinkPolicy.

The runtime spawns no task per decision, request or attempt: a decision runs on the caller’s task. The one spawned task is the delivery worker of the queued sink policies (spec 003, 3.4.3).

Re-exports§

pub use clock::Clock;
pub use clock::Instant;
pub use clock::ManualClock;
pub use clock::TokioClock;
pub use ledger::Ledger;

Modules§

clock
The runtime’s only source of elapsed time (spec 003, 3.3.1): a monotonic millisecond counter. Domain evaluation time is never read here; the caller supplies it with each decision.
ledger
Cost ledgers (spec 003, 3.5). A ledger reserves before dispatch, under a lock, so concurrent attempts cannot together reserve past its limit; it settles each reservation against the charge the adapter reported, and keeps a reservation as liability whenever the final cost is unknown.

Structs§

CaptureConfig
What to capture under. The scope is the host’s isolation choice for retained evidence; it is separate from, and never changes, the principal handle passed to backends.
CapturedDecision
The normal decide result, and beside it the capture, also when evidence delivery failed.
Decided
DecisionRequest
One decision to run.
DeliveryFailure
Why a delivery did not produce a receipt.
DeliveryTicket
Resolves when the worker has delivered, or failed to deliver, a queued record.
DynamicAsked
Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. What ask_dynamic returns: the outcome, and beside it its delivery.
DynamicBounds
Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. The bounds of one dynamic request, fresh for each call.
Gauges
Live counts, for operators and tests. In memory only.
GenerationStream
One decision’s stream. Dropping the receiver never blocks execution.
Invalidated
The selected generation after an invalidation, and the entries it removed.
InvalidationResult
LiveRequest
One live re-execution to run. Nothing here is taken from a replay bundle.
LiveResult
A finished live re-execution: the ordinary result of a new decision and its live document, returned also when evidence delivery failed, so every attempt, charge and remote state stays with the caller (spec 026, 5).
LiveSpend
Gate and explicit binding declarations for one live decision.
PreparedPlan
A compiled plan checked against this runtime’s backends.
PutTerms
The conditions of one put (3.4.1 and 3.4.4).
Runtime
RuntimeBuilder
RuntimeConfig
Bounds of one runtime (spec 003, 3.4).
ServedFromCache
The entry a decision was served from (spec 044, 3.6.6), as its run record’s decision_cache member names it.
SinkStats
A snapshot of the delivery counters.
SpendAttempt
SpendBinding
An exact binding and its host-declared cost unit.
SpendRefusal
StepProgress
A recorded result, without value bytes or authorization semantics.
StoreCall
What a store call made for a decision receives (3.4.1): the decision’s remaining time and a signal raised on its cancellation or deadline.
StoreFailure
A store failure, timeout or cancellation (3.4.1). It never fails an inference that already happened.
Stored
The bytes under a key, if any, with the generations read atomically with them.

Enums§

CaptureConfigError
A capture configuration refused before admission.
CaptureOutcome
What Runtime::decide_with_capture captured (spec 004, 5.3).
Completion
ConfigError
DecideError
Delivery
DispatchAnswer
The host’s answer about one proposed attempt. In process only: it is neither serializable nor clonable, the runtime keeps nothing of it but the reference, and it authorizes no action outside that one dispatch.
DynamicDelivery
Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. Whether the outcome reached the sink. A failed delivery never changes the outcome.
GenerationEvent
Only checked fields and delivery bookkeeping cross this interface.
LiveRefusal
Why a live re-execution was refused or failed. Except for GenerationFailed, nothing was presented to the authorizer, dispatched or spent.
PersistentInvalidation
The persistent tier’s part of an invalidation (spec 044, 3.10.3).
PrepareError
Why a plan cannot run on this runtime (spec 003, 3.5.3 and 3.6.5).
PutAnswer
How a put ended. Every answer but Stored is an admission not made.
Rejection
Why a decision was not admitted (spec 003, 3.4.1). Nothing was dispatched or spent, and there is no run record.
SinkPolicy
How evidence reaches the sink, and what the caller receives.
SpendUnit
Host declaration of the binding’s cost units.
StoreSelector
Which entries an invalidation covers.

Constants§

MAX_CAPTURE_BYTES
The largest byte limit a capture may be configured with.

Traits§

LiveAuthorizer
The host’s authorization seam (spec 026, 3.3). Rustev mints no token: the host decides, from its own trusted facts, whether this exact attempt may be sent. Ok(None) is no answer (missing); Err is a failure of the authorizer (errored); a panic is contained and errored. Every one of them prevents dispatch.
ProgressObserver
Synchronous, non-blocking callbacks. Implementations must perform no I/O, acquire no contended locks, and never wait for a consumer. Panics are counted and contained by the runtime. Observation cannot alter evidence.
RuntimeStore
A host-implemented store (3.4.1). Every call is polled on the task of the decision that made it.
SpendGate
A reservation must be durable before returning success. Settlement failures must retain liability. Implementations must not panic.

Functions§

ask_dynamic
Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. Dynamic questions (spec 019): the only execution entry point. Ask one dynamic question (spec 019, 3.1): question was validated against the host’s allowlist, backend is the host’s choice, cx carries the non-secret trace id and principal handle (its remaining time is set here), and cancel is the caller’s cancellation.

Type Aliases§

SpendTicket
In-process accounting state, consumed exactly once by its gate. This is never authorization for an action executor.