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§
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>
Sourcefn set_group_intent_superseded(&self, intent_id: ID) -> Result<(), StorageError>
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.
Sourcefn supersede_pending_intents_for_inactive_group(
&self,
group_id: &[u8],
) -> Result<usize, StorageError>
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.
fn set_group_intent_to_publish(&self, intent_id: ID) -> Result<(), StorageError>
Sourcefn set_group_intent_error(&self, intent_id: ID) -> Result<(), StorageError>
fn set_group_intent_error(&self, intent_id: ID) -> Result<(), StorageError>
Set the intent with the given ID to Error
fn find_group_intent_by_payload_hash( &self, payload_hash: &[u8], ) -> Result<Option<StoredGroupIntent>, StorageError>
Sourcefn own_intent_kind_is_unreadable(
&self,
payload_hash: &[u8],
) -> Result<bool, StorageError>
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.
Sourcefn find_dependant_commits<P: AsRef<[u8]>>(
&self,
payload_hashes: &[P],
) -> Result<HashMap<PayloadHash, IntentDependency>, StorageError>
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
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>
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.