Skip to main content

InMemoryControlledStore

Struct InMemoryControlledStore 

Source
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: u64

Implementations§

Source§

impl InMemoryControlledStore

Source

pub fn new() -> InMemoryControlledStore

Source

pub fn set_graph_revision(&mut self, graph_id: impl Into<String>, revision: u64)

Source

pub fn set_node_control_revision( &mut self, graph_id: impl Into<String>, node_id: impl Into<String>, revision: u64, )

Source

pub fn mark_invocation_settled( &mut self, graph_id: impl Into<String>, node_id: impl Into<String>, invocation_id: impl Into<String>, )

Source

pub fn mark_stop_requested( &mut self, graph_id: impl Into<String>, target: impl Into<String>, )

Source

pub fn mark_pause_negotiating( &mut self, graph_id: impl Into<String>, target: impl Into<String>, )

Source

pub fn clear_pause_negotiating(&mut self, graph_id: &str, target: &str)

Source

pub fn set_graph_barrier(&mut self, graph_id: impl Into<String>, active: bool)

Source

pub fn set_target_generation( &mut self, graph_id: impl Into<String>, target: impl Into<String>, generation: u64, )

Source

pub fn revoke_grant( &mut self, principal_id: impl Into<String>, grant: OperationGrant, )

Trait Implementations§

Source§

impl Clone for InMemoryControlledStore

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl ControlledStore for InMemoryControlledStore

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. Read more
Source§

impl Debug for InMemoryControlledStore

Source§

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

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

impl Default for InMemoryControlledStore

Source§

fn default() -> InMemoryControlledStore

Returns the “default value” for a type. 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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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