Skip to main content

QueryGroupIntent

Trait QueryGroupIntent 

Source
pub trait QueryGroupIntent {
Show 14 methods // Required methods fn insert_group_intent( &self, to_save: NewGroupIntent, ) -> Result<StoredGroupIntent, ConnectionError>; fn find_group_intents<Id: AsRef<[u8]>>( &self, group_id: Id, allowed_states: Option<Vec<IntentState>>, allowed_kinds: Option<Vec<IntentKind>>, ) -> Result<Vec<StoredGroupIntent>, ConnectionError>; fn set_group_intent_published( &self, intent_id: ID, payload_hash: &[u8], post_commit_data: Option<Vec<u8>>, staged_commit: Option<Vec<u8>>, published_in_epoch: i64, ) -> Result<(), StorageError>; fn set_group_intent_committed( &self, intent_id: ID, cursor: Cursor, ) -> Result<(), StorageError>; fn set_group_intent_processed( &self, intent_id: ID, ) -> Result<(), StorageError>; fn set_group_intent_superseded( &self, intent_id: ID, ) -> Result<(), StorageError>; fn supersede_pending_intents_for_inactive_group( &self, group_id: &[u8], ) -> Result<usize, StorageError>; fn set_group_intent_to_publish( &self, intent_id: ID, ) -> Result<(), StorageError>; fn set_group_intent_error(&self, intent_id: ID) -> Result<(), StorageError>; fn find_group_intent_by_payload_hash( &self, payload_hash: &[u8], ) -> Result<Option<StoredGroupIntent>, StorageError>; fn own_intent_kind_is_unreadable( &self, payload_hash: &[u8], ) -> Result<bool, StorageError>; fn find_dependant_commits<P: AsRef<[u8]>>( &self, payload_hashes: &[P], ) -> Result<HashMap<PayloadHash, IntentDependency>, StorageError>; fn increment_intent_publish_attempt_count( &self, intent_id: ID, ) -> Result<(), StorageError>; fn set_group_intent_error_and_fail_msg( &self, intent: &StoredGroupIntent, msg_id: Option<Vec<u8>>, ) -> Result<(), StorageError>;
}

Required Methods§

Source

fn insert_group_intent( &self, to_save: NewGroupIntent, ) -> Result<StoredGroupIntent, ConnectionError>

Source

fn find_group_intents<Id: AsRef<[u8]>>( &self, group_id: Id, allowed_states: Option<Vec<IntentState>>, allowed_kinds: Option<Vec<IntentKind>>, ) -> Result<Vec<StoredGroupIntent>, ConnectionError>

Source

fn set_group_intent_published( &self, intent_id: ID, payload_hash: &[u8], post_commit_data: Option<Vec<u8>>, staged_commit: Option<Vec<u8>>, published_in_epoch: i64, ) -> Result<(), StorageError>

Source

fn set_group_intent_committed( &self, intent_id: ID, cursor: Cursor, ) -> Result<(), StorageError>

Source

fn set_group_intent_processed(&self, intent_id: ID) -> Result<(), StorageError>

Source

fn set_group_intent_superseded(&self, intent_id: ID) -> Result<(), StorageError>

Set the intent with the given ID to Superseded — abandoned because its compare-and-swap guard no longer matches the committed state.

Source

fn supersede_pending_intents_for_inactive_group( &self, group_id: &[u8], ) -> Result<usize, StorageError>

Abandon every unpublished and unconfirmed intent for a group that this installation is no longer a member of. Returns the number abandoned.

These become IntentState::Error, not Superseded: the write did not lose a compare-and-swap race, so reporting it as one would tell the caller to re-derive from a value that did not change and queue again.

Committed intents are deliberately excluded: their post-commit work already landed on the network and may still owe Welcomes to members this installation added, which must still be published.

Source

fn set_group_intent_to_publish(&self, intent_id: ID) -> Result<(), StorageError>

Source

fn set_group_intent_error(&self, intent_id: ID) -> Result<(), StorageError>

Set the intent with the given ID to Error

Source

fn find_group_intent_by_payload_hash( &self, payload_hash: &[u8], ) -> Result<Option<StoredGroupIntent>, StorageError>

Source

fn own_intent_kind_is_unreadable( &self, payload_hash: &[u8], ) -> Result<bool, StorageError>

True when a row with this payload hash exists but carries an IntentKind this build cannot decode.

The hash is unique and is the SHA-256 of this installation’s own prepared envelope, so a match identifies our own echo. Identity must not be filtered by kind: reporting “no intent” for our own message sends it down the external-message path. Callers use this to reject the envelope terminally instead of failing the whole query and retrying forever.

Source

fn find_dependant_commits<P: AsRef<[u8]>>( &self, payload_hashes: &[P], ) -> Result<HashMap<PayloadHash, IntentDependency>, StorageError>

find the commit message refresh state for each intent payload hash

Source

fn increment_intent_publish_attempt_count( &self, intent_id: ID, ) -> Result<(), StorageError>

Source

fn set_group_intent_error_and_fail_msg( &self, intent: &StoredGroupIntent, msg_id: Option<Vec<u8>>, ) -> Result<(), StorageError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> QueryGroupIntent for &T

Source§

fn insert_group_intent( &self, to_save: NewGroupIntent, ) -> Result<StoredGroupIntent, ConnectionError>

Source§

fn find_group_intents<Id: AsRef<[u8]>>( &self, group_id: Id, allowed_states: Option<Vec<IntentState>>, allowed_kinds: Option<Vec<IntentKind>>, ) -> Result<Vec<StoredGroupIntent>, ConnectionError>

Source§

fn set_group_intent_published( &self, intent_id: ID, payload_hash: &[u8], post_commit_data: Option<Vec<u8>>, staged_commit: Option<Vec<u8>>, published_in_epoch: i64, ) -> Result<(), StorageError>

Source§

fn set_group_intent_committed( &self, intent_id: ID, cursor: Cursor, ) -> Result<(), StorageError>

Source§

fn set_group_intent_processed(&self, intent_id: ID) -> Result<(), StorageError>

Source§

fn set_group_intent_superseded(&self, intent_id: ID) -> Result<(), StorageError>

Source§

fn supersede_pending_intents_for_inactive_group( &self, group_id: &[u8], ) -> Result<usize, StorageError>

Source§

fn set_group_intent_to_publish(&self, intent_id: ID) -> Result<(), StorageError>

Source§

fn set_group_intent_error(&self, intent_id: ID) -> Result<(), StorageError>

Source§

fn find_group_intent_by_payload_hash( &self, payload_hash: &[u8], ) -> Result<Option<StoredGroupIntent>, StorageError>

Source§

fn own_intent_kind_is_unreadable( &self, payload_hash: &[u8], ) -> Result<bool, StorageError>

Source§

fn find_dependant_commits<P: AsRef<[u8]>>( &self, payload_hashes: &[P], ) -> Result<HashMap<PayloadHash, IntentDependency>, StorageError>

Source§

fn increment_intent_publish_attempt_count( &self, intent_id: ID, ) -> Result<(), StorageError>

Source§

fn set_group_intent_error_and_fail_msg( &self, intent: &StoredGroupIntent, msg_id: Option<Vec<u8>>, ) -> Result<(), StorageError>

Implementors§