pub struct InMemoryControlledStore {
pub graph_revisions: BTreeMap<String, u64>,
pub node_control_revisions: BTreeMap<(String, String), u64>,
pub settled_invocations: BTreeSet<(String, String, String)>,
pub stop_requested_targets: BTreeSet<(String, String)>,
pub pause_negotiating_targets: BTreeSet<(String, String)>,
pub graph_barriers: BTreeSet<String>,
pub target_generations: BTreeMap<(String, String), u64>,
pub revoked_grants: BTreeSet<(String, OperationGrant)>,
pub idempotency_log: BTreeMap<String, (AdmissionReceipt, String)>,
pub admitted_queue: Vec<AdmissionReceipt>,
pub next_sequence: u64,
}Expand description
In-memory controlled store implementing ControlledStore for tests and isolated execution.
Fields§
§graph_revisions: BTreeMap<String, u64>§node_control_revisions: BTreeMap<(String, String), u64>§settled_invocations: BTreeSet<(String, String, String)>§stop_requested_targets: BTreeSet<(String, String)>§pause_negotiating_targets: BTreeSet<(String, String)>§graph_barriers: BTreeSet<String>§target_generations: BTreeMap<(String, String), u64>§revoked_grants: BTreeSet<(String, OperationGrant)>§idempotency_log: BTreeMap<String, (AdmissionReceipt, String)>§admitted_queue: Vec<AdmissionReceipt>§next_sequence: u64Implementations§
Source§impl InMemoryControlledStore
impl InMemoryControlledStore
pub fn new() -> InMemoryControlledStore
pub fn set_graph_revision(&mut self, graph_id: impl Into<String>, revision: u64)
pub fn set_node_control_revision( &mut self, graph_id: impl Into<String>, node_id: impl Into<String>, revision: u64, )
pub fn mark_invocation_settled( &mut self, graph_id: impl Into<String>, node_id: impl Into<String>, invocation_id: impl Into<String>, )
pub fn mark_stop_requested( &mut self, graph_id: impl Into<String>, target: impl Into<String>, )
pub fn mark_pause_negotiating( &mut self, graph_id: impl Into<String>, target: impl Into<String>, )
pub fn clear_pause_negotiating(&mut self, graph_id: &str, target: &str)
pub fn set_graph_barrier(&mut self, graph_id: impl Into<String>, active: bool)
pub fn set_target_generation( &mut self, graph_id: impl Into<String>, target: impl Into<String>, generation: u64, )
pub fn revoke_grant( &mut self, principal_id: impl Into<String>, grant: OperationGrant, )
Trait Implementations§
Source§impl Clone for InMemoryControlledStore
impl Clone for InMemoryControlledStore
Source§fn clone(&self) -> InMemoryControlledStore
fn clone(&self) -> InMemoryControlledStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ControlledStore for InMemoryControlledStore
impl ControlledStore for InMemoryControlledStore
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn 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).
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn 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. Read more
Source§impl Debug for InMemoryControlledStore
impl Debug for InMemoryControlledStore
Source§impl Default for InMemoryControlledStore
impl Default for InMemoryControlledStore
Source§fn default() -> InMemoryControlledStore
fn default() -> InMemoryControlledStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for InMemoryControlledStore
impl Freeze for InMemoryControlledStore
impl Move for InMemoryControlledStore
impl RefUnwindSafe for InMemoryControlledStore
impl Send for InMemoryControlledStore
impl Sync for InMemoryControlledStore
impl Unpin for InMemoryControlledStore
impl UnsafeUnpin for InMemoryControlledStore
impl UnwindSafe for InMemoryControlledStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more