pub trait ControlledStore: Send + Sync {
// Required methods
fn get_graph_revision(
&self,
graph_id: &str,
) -> Result<Option<u64>, AdmissionConflict>;
fn get_node_control_revision(
&self,
graph_id: &str,
node_id: &str,
) -> Result<Option<u64>, AdmissionConflict>;
fn is_invocation_settled(
&self,
graph_id: &str,
node_id: &str,
invocation_id: &str,
) -> Result<bool, AdmissionConflict>;
fn is_stop_requested(
&self,
graph_id: &str,
target: &str,
) -> Result<bool, AdmissionConflict>;
fn is_pause_negotiating(
&self,
graph_id: &str,
target: &str,
) -> Result<bool, AdmissionConflict>;
fn is_graph_barrier_active(
&self,
graph_id: &str,
) -> Result<bool, AdmissionConflict>;
fn get_target_generation(
&self,
graph_id: &str,
target: &str,
) -> Result<Option<u64>, AdmissionConflict>;
fn is_grant_revoked(
&self,
principal_id: &str,
grant: &OperationGrant,
) -> Result<bool, AdmissionConflict>;
fn find_idempotency_record(
&self,
request_id: &str,
) -> Result<Option<(AdmissionReceipt, String)>, AdmissionConflict>;
fn record_admission(
&mut self,
receipt: &mut AdmissionReceipt,
payload_digest: String,
expected_control_revision: Option<u64>,
fences: &AdmissionFences,
) -> Result<(), AdmissionConflict>;
}Expand description
Port/contract for the controlled store managing graph state, revisions, and admission log.
Every read fails closed: a lookup error is Err(Storage), never a quiet
“not revoked” or “not stopped” answer.
Required Methods§
Sourcefn get_graph_revision(
&self,
graph_id: &str,
) -> Result<Option<u64>, AdmissionConflict>
fn get_graph_revision( &self, graph_id: &str, ) -> Result<Option<u64>, AdmissionConflict>
Return the current graph definition revision if the graph exists.
Sourcefn get_node_control_revision(
&self,
graph_id: &str,
node_id: &str,
) -> Result<Option<u64>, AdmissionConflict>
fn get_node_control_revision( &self, graph_id: &str, node_id: &str, ) -> Result<Option<u64>, AdmissionConflict>
Return the current control revision for the specified node.
Sourcefn is_invocation_settled(
&self,
graph_id: &str,
node_id: &str,
invocation_id: &str,
) -> Result<bool, AdmissionConflict>
fn is_invocation_settled( &self, graph_id: &str, node_id: &str, invocation_id: &str, ) -> Result<bool, AdmissionConflict>
Check if the invocation has already completed/settled.
Sourcefn is_stop_requested(
&self,
graph_id: &str,
target: &str,
) -> Result<bool, AdmissionConflict>
fn is_stop_requested( &self, graph_id: &str, target: &str, ) -> Result<bool, AdmissionConflict>
Check if stop has already been requested for this target (node or graph).
Sourcefn is_pause_negotiating(
&self,
graph_id: &str,
target: &str,
) -> Result<bool, AdmissionConflict>
fn is_pause_negotiating( &self, graph_id: &str, target: &str, ) -> Result<bool, AdmissionConflict>
Check if pause is currently being negotiated for this target.
Sourcefn is_graph_barrier_active(
&self,
graph_id: &str,
) -> Result<bool, AdmissionConflict>
fn is_graph_barrier_active( &self, graph_id: &str, ) -> Result<bool, AdmissionConflict>
Check if a graph-scope admission barrier is currently active.
Sourcefn get_target_generation(
&self,
graph_id: &str,
target: &str,
) -> Result<Option<u64>, AdmissionConflict>
fn get_target_generation( &self, graph_id: &str, target: &str, ) -> Result<Option<u64>, AdmissionConflict>
Return the target’s current lifecycle generation.
Sourcefn is_grant_revoked(
&self,
principal_id: &str,
grant: &OperationGrant,
) -> Result<bool, AdmissionConflict>
fn is_grant_revoked( &self, principal_id: &str, grant: &OperationGrant, ) -> Result<bool, AdmissionConflict>
Check if a grant has been dynamically revoked for this principal.
Sourcefn find_idempotency_record(
&self,
request_id: &str,
) -> Result<Option<(AdmissionReceipt, String)>, AdmissionConflict>
fn find_idempotency_record( &self, request_id: &str, ) -> Result<Option<(AdmissionReceipt, String)>, AdmissionConflict>
Look up an idempotency record by request_id.
Sourcefn record_admission(
&mut self,
receipt: &mut AdmissionReceipt,
payload_digest: String,
expected_control_revision: Option<u64>,
fences: &AdmissionFences,
) -> Result<(), AdmissionConflict>
fn record_admission( &mut self, receipt: &mut AdmissionReceipt, payload_digest: String, expected_control_revision: Option<u64>, fences: &AdmissionFences, ) -> Result<(), AdmissionConflict>
Durably commit an admitted command to the queue.
The store assigns the monotonically increasing admission sequence on
the receipt, persists the admitted control revision of the target
node, and records the stop/pause negotiation facts implied by the
operation. expected_control_revision and every fence in fences
are re-verified inside the committing transaction, so a revocation,
stop, pause, barrier, or generation change committed between the
proxy’s prechecks and this commit cannot admit a stale operation;
the committed revision the store assigned lands on
receipt.control_revision.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".