Skip to main content

ControlledStore

Trait ControlledStore 

Source
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§

Source

fn get_graph_revision( &self, graph_id: &str, ) -> Result<Option<u64>, AdmissionConflict>

Return the current graph definition revision if the graph exists.

Source

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.

Source

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.

Source

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).

Source

fn is_pause_negotiating( &self, graph_id: &str, target: &str, ) -> Result<bool, AdmissionConflict>

Check if pause is currently being negotiated for this target.

Source

fn is_graph_barrier_active( &self, graph_id: &str, ) -> Result<bool, AdmissionConflict>

Check if a graph-scope admission barrier is currently active.

Source

fn get_target_generation( &self, graph_id: &str, target: &str, ) -> Result<Option<u64>, AdmissionConflict>

Return the target’s current lifecycle generation.

Source

fn is_grant_revoked( &self, principal_id: &str, grant: &OperationGrant, ) -> Result<bool, AdmissionConflict>

Check if a grant has been dynamically revoked for this principal.

Source

fn find_idempotency_record( &self, request_id: &str, ) -> Result<Option<(AdmissionReceipt, String)>, AdmissionConflict>

Look up an idempotency record by request_id.

Source

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".

Implementations on Foreign Types§

Source§

impl ControlledStore for DurableControlledStore

Source§

fn get_graph_revision( &self, graph_id: &str, ) -> Result<Option<u64>, AdmissionConflict>

Source§

fn get_node_control_revision( &self, graph_id: &str, node_id: &str, ) -> Result<Option<u64>, AdmissionConflict>

Source§

fn is_invocation_settled( &self, graph_id: &str, node_id: &str, invocation_id: &str, ) -> Result<bool, AdmissionConflict>

Source§

fn is_stop_requested( &self, graph_id: &str, target: &str, ) -> Result<bool, AdmissionConflict>

Source§

fn is_pause_negotiating( &self, graph_id: &str, target: &str, ) -> Result<bool, AdmissionConflict>

Source§

fn is_graph_barrier_active( &self, graph_id: &str, ) -> Result<bool, AdmissionConflict>

Source§

fn get_target_generation( &self, graph_id: &str, target: &str, ) -> Result<Option<u64>, AdmissionConflict>

Source§

fn is_grant_revoked( &self, principal_id: &str, grant: &OperationGrant, ) -> Result<bool, AdmissionConflict>

Source§

fn find_idempotency_record( &self, request_id: &str, ) -> Result<Option<(AdmissionReceipt, String)>, AdmissionConflict>

Source§

fn record_admission( &mut self, receipt: &mut AdmissionReceipt, payload_digest: String, expected_control_revision: Option<u64>, fences: &AdmissionFences, ) -> Result<(), AdmissionConflict>

Implementors§