Skip to main content

DbConnection

Struct DbConnection 

Source
pub struct DbConnection<C> { /* private fields */ }
Expand description

A wrapper for RawDbConnection that houses all XMTP DB operations.

Implementations§

Source§

impl<C> DbConnection<C>

Source

pub fn new(conn: C) -> Self

Trait Implementations§

Source§

impl<C: Clone> Clone for DbConnection<C>

Source§

fn clone(&self) -> DbConnection<C>

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<C> ConnectionExt for DbConnection<C>
where C: ConnectionExt,

Source§

fn raw_query<T, F>(&self, fun: F) -> Result<T, ConnectionError>
where F: FnOnce(&mut SqliteConnection) -> Result<T, Error>, Self: Sized,

Run a scoped query against the underlying SQLite connection.
Source§

fn disconnect(&self) -> Result<(), ConnectionError>

Source§

fn reconnect(&self) -> Result<(), ConnectionError>

Source§

impl<C> Debug for DbConnection<C>

Source§

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

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

impl<C: ConnectionExt> Delete<StoredGroupIntent> for DbConnection<C>

Source§

impl<C: ConnectionExt> Delete<StoredKeyStoreEntry> for DbConnection<C>

Source§

impl<C: ConnectionExt> From<DbConnection<C>> for XmtpOpenMlsProvider<SqlKeyStore<C>>

Source§

fn from(db: DbConnection<C>) -> XmtpOpenMlsProvider<SqlKeyStore<C>>

Converts to this type from the input type.
Source§

impl<C: ConnectionExt> IntoConnection for DbConnection<C>

Source§

impl<C: ConnectionExt> Pragmas for DbConnection<C>

Source§

fn busy_timeout(&self) -> Result<i32, ConnectionError>

Check the busy timeout value
Source§

fn set_sqlcipher_log<S: AsRef<str>>( &self, level: S, ) -> Result<(), ConnectionError>

Source§

impl<C: ConnectionExt> QueryAssociationStateCache for DbConnection<C>

Source§

fn write_to_cache( &self, inbox_id: String, sequence_id: i64, state: AssociationStateProto, ) -> Result<(), StorageError>

Source§

fn read_from_cache<A: AsRef<str>>( &self, inbox_id: A, sequence_id: i64, ) -> Result<Option<AssociationStateProto>, StorageError>

Source§

fn batch_read_from_cache( &self, identifiers: Vec<(String, i64)>, ) -> Result<Vec<AssociationStateProto>, StorageError>

Source§

impl<C: ConnectionExt> QueryConsentRecord for DbConnection<C>

Returns the consent_records for the given entity up

Insert consent_records, and replace existing entries, returns records that are new or changed

Source§

fn consent_records(&self) -> Result<Vec<StoredConsentRecord>, ConnectionError>

Source§

fn consent_records_paged( &self, limit: i64, offset: i64, ) -> Result<Vec<StoredConsentRecord>, ConnectionError>

Returns true if newer
Source§

impl<C: ConnectionExt> QueryConversationList for DbConnection<C>

Source§

impl<C: ConnectionExt> QueryDeviceSyncMessages for DbConnection<C>

Source§

fn unprocessed_sync_group_messages( &self, ) -> Result<Vec<StoredGroupMessage>, StorageError>

Source§

fn sync_group_messages_paged( &self, offset: i64, limit: i64, ) -> Result<Vec<StoredGroupMessage>, StorageError>

Source§

fn mark_device_sync_msg_as_processed( &self, message_id: &[u8], ) -> Result<(), StorageError>

Marks a device sync message as processed.
Source§

fn increment_device_sync_msg_attempt( &self, message_id: &[u8], max_attempts: i32, ) -> Result<i32, StorageError>

Increments the attempt count for a device sync message. If the attempt count reaches max_attempts, the state is set to Failed. Returns the new attempt count.
Source§

impl<C: ConnectionExt> QueryDms for DbConnection<C>

Source§

fn fetch_stitched( &self, key: &GroupId, ) -> Result<Option<StoredGroup>, ConnectionError>

Same behavior as fetched, but will stitch DM groups

Source§

fn other_dms( &self, group_id: &GroupId, ) -> Result<Vec<StoredGroup>, ConnectionError>

Load the other DMs that are stitched into this group

Source§

fn find_active_dm_group<M>( &self, members: M, ) -> Result<Option<StoredGroup>, ConnectionError>
where M: Display,

Source§

impl<C: ConnectionExt> QueryGroup for DbConnection<C>

Source§

fn find_groups<A: AsRef<GroupQueryArgs>>( &self, args: A, ) -> Result<Vec<StoredGroup>, ConnectionError>

Return regular Purpose::Conversation groups with additional optional filters

Source§

fn update_group_membership<Id: AsRef<[u8]>>( &self, group_id: Id, state: GroupMembershipState, ) -> Result<(), ConnectionError>

Updates group membership state

Source§

fn find_group( &self, id: &GroupId, ) -> Result<Option<StoredGroup>, ConnectionError>

Return a single group that matches the given ID

Source§

fn find_group_by_sequence_id( &self, cursor: Cursor, ) -> Result<Option<StoredGroup>, ConnectionError>

Return a single group that matches the given welcome ID

Source§

fn update_rotated_at_ns(&self, group_id: &GroupId) -> Result<(), StorageError>

Updates the ‘last time checked’ we checked for new installations.

Source§

fn update_installations_time_checked( &self, group_id: &GroupId, ) -> Result<(), StorageError>

Updates the ‘last time checked’ we checked for new installations.

Source§

fn group_cursors(&self) -> Result<Vec<Cursor>, ConnectionError>

Get all the welcome ids turned into groups

Source§

fn get_conversation_ids_for_remote_log_publish( &self, ) -> Result<Vec<StoredGroupCommitLogPublicKey>, ConnectionError>

Get conversation IDs for all conversations that require a remote commit log publish (DMs and groups where user is super admin, excluding sync groups and rejected groups)

Source§

fn find_groups_by_id_paged<A: AsRef<GroupQueryArgs>>( &self, args: A, offset: i64, ) -> Result<Vec<StoredGroup>, ConnectionError>

Source§

fn all_sync_groups(&self) -> Result<Vec<StoredGroup>, ConnectionError>

Source§

fn find_sync_group( &self, id: &GroupId, ) -> Result<Option<StoredGroup>, ConnectionError>

Source§

fn primary_sync_group(&self) -> Result<Option<StoredGroup>, ConnectionError>

Source§

fn get_rotated_at_ns(&self, group_id: &GroupId) -> Result<i64, StorageError>

Source§

fn get_installations_time_checked( &self, group_id: &GroupId, ) -> Result<i64, StorageError>

Source§

fn update_message_disappearing_from_ns( &self, group_id: &GroupId, from_ns: Option<i64>, ) -> Result<(), StorageError>

Source§

fn update_message_disappearing_in_ns( &self, group_id: &GroupId, in_ns: Option<i64>, ) -> Result<(), StorageError>

Source§

fn insert_or_replace_group( &self, group: StoredGroup, ) -> Result<StoredGroup, StorageError>

Source§

fn mark_group_as_maybe_forked( &self, group_id: &GroupId, fork_details: String, ) -> Result<(), StorageError>

Source§

fn clear_fork_flag_for_group( &self, group_id: &GroupId, ) -> Result<(), ConnectionError>

Source§

fn has_duplicate_dm(&self, group_id: &GroupId) -> Result<bool, ConnectionError>

Source§

fn get_conversation_ids_for_remote_log_download( &self, ) -> Result<Vec<StoredGroupCommitLogPublicKey>, ConnectionError>

Get conversations for all conversations that require a remote commit log download (DMs and groups that are not sync groups)
Source§

fn get_conversation_ids_for_fork_check( &self, ) -> Result<Vec<Vec<u8>>, ConnectionError>

Get conversation IDs for fork checking (excludes already forked conversations and sync groups)
Source§

fn get_conversation_ids_for_requesting_readds( &self, ) -> Result<Vec<StoredGroupForReaddRequest>, ConnectionError>

Get conversation IDs for conversations that are forked and need readd requests
Source§

fn get_conversation_ids_for_responding_readds( &self, ) -> Result<Vec<StoredGroupForRespondingReadds>, ConnectionError>

Get conversation IDs for conversations that need to respond to readd requests
Source§

fn get_conversation_type( &self, group_id: &GroupId, ) -> Result<ConversationType, ConnectionError>

Source§

fn set_group_commit_log_public_key( &self, group_id: &GroupId, public_key: &[u8], ) -> Result<(), StorageError>

Updates the commit log public key for a group
Source§

fn set_group_commit_log_forked_status( &self, group_id: &GroupId, is_forked: Option<bool>, ) -> Result<(), StorageError>

Updates the is_commit_log_forked status for a group
Source§

fn get_group_commit_log_forked_status( &self, group_id: &GroupId, ) -> Result<Option<bool>, StorageError>

Gets the is_commit_log_forked status for a group
Source§

fn set_group_has_pending_leave_request_status( &self, group_id: &GroupId, has_pending_leave_request: Option<bool>, ) -> Result<(), StorageError>

Updates the has_pending_leave_request status for a group
Source§

fn get_groups_have_pending_leave_request( &self, ) -> Result<Vec<Vec<u8>>, ConnectionError>

Source§

impl<C: ConnectionExt> QueryGroupIntent for DbConnection<C>

Source§

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

Mark the intent abandoned because its compare-and-swap guard no longer matches. Terminal, and deliberately not Error: the caller needs to tell a stale write apart from a genuine failure.

Source§

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

Removal is terminal for work that has not been accepted by the group. The state is Error, not Superseded: nothing raced this write. A ToPublish intent can never be published now, and a Published one can never be confirmed: its own echo is unreachable behind the inactive boundary, and a later re-add installs fresh state past it. Leaving those intents in place strands them, and a stranded Published state change preempts every later intent on the group.

The prepared attempt is cleared with the state so no stale bytes can be reused against a new membership generation.

Source§

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

Set the intent with the given ID to Error

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 by payload hash. Returns a map from payload hash to a vector of group dependencies.

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_to_publish(&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>

True when a row with this payload hash exists but carries an IntentKind this build cannot decode. Read more
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>

Source§

impl<C: ConnectionExt> QueryGroupMessage for DbConnection<C>

Source§

fn get_group_messages( &self, group_id: &GroupId, args: &MsgQueryArgs, ) -> Result<Vec<StoredGroupMessage>, ConnectionError>

Query for group messages

Source§

fn count_group_messages( &self, group_id: &GroupId, args: &MsgQueryArgs, ) -> Result<i64, ConnectionError>

Count group messages matching the given criteria

Source§

fn get_group_messages_with_reactions( &self, group_id: &GroupId, args: &MsgQueryArgs, ) -> Result<Vec<StoredGroupMessageWithReactions>, ConnectionError>

Query for group messages with their reactions

Source§

fn get_group_message<MessageId: AsRef<[u8]>>( &self, id: MessageId, ) -> Result<Option<StoredGroupMessage>, ConnectionError>

Get a particular group message

Source§

fn write_conn_get_group_message<MessageId: AsRef<[u8]>>( &self, id: MessageId, ) -> Result<Option<StoredGroupMessage>, ConnectionError>

Get a particular group message using the write connection

Source§

fn missing_messages( &self, group_id: &GroupId, sequence_ids: &[u64], ) -> Result<Vec<StoredGroupMessage>, ConnectionError>

Return all Application-kind messages stored locally for group_id whose sequence_id is NOT in the provided list. Used by tools that compare local state against an authoritative set of sequence ids (e.g. xdbg’s healthcheck validator).
Source§

fn group_messages_paged( &self, args: &MsgQueryArgs, offset: i64, ) -> Result<Vec<StoredGroupMessage>, ConnectionError>

Source§

fn get_inbound_relations( &self, group_id: &GroupId, message_ids: &[&[u8]], relation_query: RelationQuery, ) -> Result<InboundRelations, ConnectionError>

Source§

fn get_outbound_relations( &self, group_id: &GroupId, reference_ids: &[&[u8]], ) -> Result<OutboundRelations, ConnectionError>

Source§

fn get_inbound_relation_counts( &self, group_id: &GroupId, message_ids: &[&[u8]], relation_query: RelationQuery, ) -> Result<RelationCounts, ConnectionError>

Source§

fn get_latest_message_times_by_sender<Id: AsRef<[u8]>>( &self, group_id: Id, allowed_content_types: &[ContentType], ) -> Result<LatestMessageTimeBySender, ConnectionError>

Source§

fn get_group_message_by_timestamp<Id: AsRef<[u8]>>( &self, group_id: Id, timestamp: i64, ) -> Result<Option<StoredGroupMessage>, ConnectionError>

Source§

fn get_group_message_by_cursor<Id: AsRef<[u8]>>( &self, group_id: Id, cursor: Cursor, ) -> Result<Option<StoredGroupMessage>, ConnectionError>

Source§

fn set_delivery_status_to_published<MessageId: AsRef<[u8]>>( &self, msg_id: &MessageId, timestamp: u64, cursor: Cursor, message_expire_at_ns: Option<i64>, ) -> Result<usize, StorageError>

Source§

fn set_delivery_status_to_failed<MessageId: AsRef<[u8]>>( &self, msg_id: &MessageId, ) -> Result<usize, ConnectionError>

Source§

fn delete_expired_messages( &self, ) -> Result<Vec<StoredGroupMessage>, ConnectionError>

Source§

fn min_expire_at_ns(&self) -> Result<Option<i64>, ConnectionError>

The soonest expire_at_ns among published Application messages that have an expiry set, or None if no disappearing messages exist. Note this can return a timestamp already in the past (an expiry that elapsed while the worker was asleep) — the caller clamps the resulting sleep to >= 0 and deletes on the next wake. Same filters as delete_expired_messages without its expire_at_ns <= now bound.
Source§

fn delete_message_by_id<MessageId: AsRef<[u8]>>( &self, message_id: MessageId, ) -> Result<usize, ConnectionError>

Source§

fn messages_newer_than( &self, cursors_by_group: &HashMap<Vec<u8>, Cursor>, ) -> Result<Vec<(GroupId, Cursor)>, ConnectionError>

Stored messages above each group’s cursor, attributed to their group. The attribution matters: sequence ids are not scoped per group, so a caller folding these into per-group state must never mix groups.
Source§

fn clear_messages( &self, group_ids: Option<&[GroupId]>, retention_days: Option<u32>, ) -> Result<usize, ConnectionError>

Clear messages from the database with optional filtering. Read more
Source§

impl<C: ConnectionExt> QueryGroupVersion for DbConnection<C>

Source§

fn set_group_paused( &self, group_id: &GroupId, min_version: &str, ) -> Result<(), StorageError>

Source§

fn unpause_group(&self, group_id: &GroupId) -> Result<(), StorageError>

Source§

fn get_group_paused_version( &self, group_id: &GroupId, ) -> Result<Option<String>, StorageError>

Source§

fn get_paused_groups_with_versions( &self, ) -> Result<Vec<(GroupId, String)>, StorageError>

Return every group currently flagged as paused, with the paused_for_version floor it’s pinned to. Used by the startup/sweep recovery path to re-evaluate paused groups against the now-current pkg_version without having to sync each group individually.
Source§

impl<C: ConnectionExt> QueryIdentity for DbConnection<C>

Source§

fn queue_key_package_rotation(&self) -> Result<(), StorageError>

Source§

fn queue_key_rotation_with_nudge( &self, rotation_task_hash: &TaskDataHash, rotation_seed: NewTask, ) -> Result<(), StorageError>

Atomically lower/initialize the rotation column (5s debounce) AND enqueue a PullInDeadline task targeting rotation_task_hash at the resulting column value — one transaction, so neither write can land without the other. rotation_seed is insert-or-ignored first so the pull-in always has a live target (commit-target-first), even if startup seeding never ran. Callers wake the TaskWorker AFTER this returns (never inside a tx).
Source§

fn reset_key_package_rotation_queue( &self, rotation_interval_ns: i64, ) -> Result<(), StorageError>

Source§

fn is_identity_needs_rotation(&self) -> Result<bool, StorageError>

Source§

fn next_key_package_rotation_ns(&self) -> Result<Option<i64>, StorageError>

The identity’s absolute rotation deadline (next_key_package_rotation_ns). None if NULL or if no identity row exists yet (indistinguishable to callers; treat as “no scheduled deadline”).
Source§

impl<C: ConnectionExt> QueryIdentityCache for DbConnection<C>

Source§

fn fetch_cached_inbox_ids( &self, identifiers: &[(String, StoredIdentityKind)], ) -> Result<HashMap<String, String>, StorageError>

Returns a HashMap of WalletAddress -> InboxId

Source§

fn cache_inbox_id<S: ToString>( &self, kind: StoredIdentityKind, identity: String, inbox_id: S, ) -> Result<(), StorageError>

Source§

impl<C: ConnectionExt> QueryIdentityUpdates for DbConnection<C>

Source§

fn get_identity_updates<InboxId: AsRef<str>>( &self, inbox_id: InboxId, from_sequence_id: Option<i64>, to_sequence_id: Option<i64>, ) -> Result<Vec<StoredIdentityUpdate>, ConnectionError>

Returns all identity updates for the given inbox ID up to the provided sequence_id. Returns updates greater than from_sequence_id and less than or equal to to_sequence_id

Source§

fn insert_or_ignore_identity_updates( &self, updates: &[StoredIdentityUpdate], ) -> Result<(), ConnectionError>

Batch insert identity updates, ignoring duplicates.

Source§

fn get_latest_sequence_id( &self, inbox_ids: &[&str], ) -> Result<HashMap<String, i64>, ConnectionError>

Given a list of inbox_ids return a HashMap of each inbox ID -> highest known sequence ID

Source§

fn get_latest_sequence_id_for_inbox( &self, inbox_id: &str, ) -> Result<i64, ConnectionError>

Source§

fn count_inbox_updates( &self, inbox_ids: &[&str], ) -> Result<HashMap<String, i64>, ConnectionError>

Returns the count of identity updates for inbox_ids
Source§

impl<C: ConnectionExt> QueryKeyPackageHistory for DbConnection<C>

Source§

fn record_key_package_publication( &self, history_id: i32, sequence: Cursor, ) -> Result<(), StorageError>

Retire keys by confirmed publication order, not local creation order. The latest published key stays usable; duplicate receipts keep the first retirement deadline.
Source§

fn store_key_package_history_entry( &self, key_package_hash_ref: Vec<u8>, post_quantum_public_key: Option<Vec<u8>>, ) -> Result<StoredKeyPackageHistoryEntry, StorageError>

Source§

fn find_key_package_history_entry_by_hash_ref( &self, hash_ref: Vec<u8>, ) -> Result<StoredKeyPackageHistoryEntry, StorageError>

Source§

fn find_key_package_history_entries_before_id( &self, id: i32, ) -> Result<Vec<StoredKeyPackageHistoryEntry>, StorageError>

Source§

fn get_expired_key_packages( &self, ) -> Result<Vec<StoredKeyPackageHistoryEntry>, StorageError>

Source§

fn min_key_package_delete_at_ns(&self) -> Result<Option<i64>, StorageError>

Soonest pending delete_at_ns across all key packages marked for deletion, or None if none are marked. The KpDeletion task’s reschedule source.
Source§

fn delete_key_package_entry_with_id(&self, id: i32) -> Result<(), StorageError>

Source§

impl<C: ConnectionExt> QueryKeyStoreEntry for DbConnection<C>

Source§

impl<C: ConnectionExt> QueryLocalCommitLog for DbConnection<C>

Source§

fn get_group_logs( &self, group_id: &GroupId, ) -> Result<Vec<LocalCommitLog>, ConnectionError>

Source§

fn get_local_commit_log_after_cursor( &self, group_id: &GroupId, after_cursor: i64, order: LocalCommitLogOrder, ) -> Result<Vec<LocalCommitLog>, ConnectionError>

Source§

fn get_latest_log_for_group( &self, group_id: &GroupId, ) -> Result<Option<LocalCommitLog>, ConnectionError>

Source§

fn get_local_commit_log_cursor( &self, group_id: &GroupId, ) -> Result<Option<i32>, ConnectionError>

Source§

fn get_latest_chain_start_rowid( &self, group_id: &GroupId, ) -> Result<Option<i32>, ConnectionError>

Rowid of the most recent chain-start entry for this group, if any. Chain-start entries have commit_sequence_id == 0 (Welcome / GroupCreation / BackupRestore) and mark the beginning of the member’s current membership session.
Source§

impl<C: ConnectionExt> QueryMessageDeletion for DbConnection<C>

Source§

fn get_message_deletion( &self, id: &[u8], ) -> Result<Option<StoredMessageDeletion>, ConnectionError>

Get a deletion record by the DeleteMessage ID
Source§

fn get_deletion_by_deleted_message_id( &self, deleted_message_id: &[u8], ) -> Result<Option<StoredMessageDeletion>, ConnectionError>

Get deletion record for a specific deleted message
Source§

fn get_deletions_for_messages( &self, message_ids: Vec<Vec<u8>>, ) -> Result<Vec<StoredMessageDeletion>, ConnectionError>

Get all deletions for a list of message IDs
Source§

fn get_group_deletions( &self, group_id: &GroupId, ) -> Result<Vec<StoredMessageDeletion>, ConnectionError>

Get all deletions in a group
Source§

fn is_message_deleted(&self, message_id: &[u8]) -> Result<bool, ConnectionError>

Check if a message has been deleted
Source§

impl<C: ConnectionExt> QueryMigrations for DbConnection<C>

Source§

fn applied_migrations(&self) -> Result<Vec<String>, ConnectionError>

Returns a list of all applied migration versions, most recent first.
Source§

fn available_migrations(&self) -> Result<Vec<String>, ConnectionError>

Returns a list of all available (embedded) migration names.
Source§

fn rollback_to_version( &self, version: &str, ) -> Result<Vec<String>, ConnectionError>

Rollback all migrations after and including the specified version. Read more
Source§

fn run_migration(&self, name: &str) -> Result<(), ConnectionError>

Run a specific migration by name. Read more
Source§

fn revert_migration(&self, name: &str) -> Result<(), ConnectionError>

Revert a specific migration by name. Read more
Source§

fn run_pending_migrations(&self) -> Result<Vec<String>, ConnectionError>

Run all pending migrations.
Source§

impl<C: ConnectionExt> QueryNotifications for DbConnection<C>

Source§

fn notification_record(&self) -> Result<StoredNotification, StorageError>

Source§

fn save_notification_record( &self, record: &StoredNotification, ) -> Result<(), StorageError>

Source§

fn uploaded_topics(&self) -> Result<Vec<UploadedTopic>, StorageError>

Source§

fn disable_notifications( &self, ) -> Result<(StoredNotification, Vec<UploadedTopic>), StorageError>

Atomically disable notifications and return the cleared uploads. Keep the recipient identity, conversation overrides, and task retry state.
Source§

fn confirm_uploaded_topics( &self, adds: &[UploadedTopic], removes: &[Vec<u8>], ) -> Result<(), StorageError>

Source§

fn clear_uploaded_topics(&self) -> Result<(), StorageError>

Source§

fn mark_uploaded_topics_stale(&self) -> Result<(), StorageError>

Source§

fn notification_groups(&self) -> Result<Vec<StoredGroup>, StorageError>

Source§

fn set_notification_override( &self, group: &GroupId, value: Option<i32>, ) -> Result<(), StorageError>

Source§

impl<C: ConnectionExt> QueryPendingRemove for DbConnection<C>

Source§

impl<C: ConnectionExt> QueryReaddStatus for DbConnection<C>

Source§

fn get_readd_status( &self, group_id: &GroupId, installation_id: &[u8], ) -> Result<Option<ReaddStatus>, ConnectionError>

Source§

fn is_awaiting_readd( &self, group_id: &GroupId, installation_id: &[u8], ) -> Result<bool, ConnectionError>

Source§

fn update_requested_at_sequence_id( &self, group_id: &GroupId, installation_id: &[u8], sequence_id: i64, ) -> Result<(), ConnectionError>

Update the requested_at_sequence_id for a given group_id and installation_id, provided it is higher than the current value. Inserts the row if it doesn’t exist.
Source§

fn update_responded_at_sequence_id( &self, group_id: &GroupId, installation_id: &[u8], sequence_id: i64, ) -> Result<(), ConnectionError>

Update the responded_at_sequence_id for a given group_id and installation_id, provided it is higher than the current value. Inserts the row if it doesn’t exist.
Source§

fn delete_other_readd_statuses( &self, group_id: &GroupId, self_installation_id: &[u8], ) -> Result<(), ConnectionError>

Source§

fn delete_readd_statuses( &self, group_id: &GroupId, installation_ids: HashSet<Vec<u8>>, ) -> Result<(), ConnectionError>

Source§

fn get_readds_awaiting_response( &self, group_id: &GroupId, self_installation_id: &[u8], ) -> Result<Vec<ReaddStatus>, ConnectionError>

Source§

impl<C: ConnectionExt> QueryRefreshState for DbConnection<C>

Source§

fn get_refresh_state<Id: AsRef<[u8]>>( &self, entity_id: Id, entity_kind: EntityKind, ) -> Result<Option<RefreshState>, StorageError>

Source§

fn get_last_cursor<Id: AsRef<[u8]>>( &self, id: Id, entity_kind: EntityKind, ) -> Result<Cursor, StorageError>

Read one ledger position. Create a zero position when it is absent.
Source§

fn get_last_cursor_for_ids<Id: AsRef<[u8]>>( &self, ids: &[Id], entities: &[EntityKind], ) -> Result<HashMap<Vec<u8>, Cursor>, StorageError>

Return the minimum position across the requested kinds for each stored id. An absent kind has position zero. Ids with no rows are absent from the map.
Source§

fn update_cursor<Id: AsRef<[u8]>>( &self, entity_id: Id, entity_kind: EntityKind, cursor: Cursor, ) -> Result<bool, StorageError>

Advance a ledger position only when the new position is greater.
Source§

fn latest_cursor_for_id<Id: AsRef<[u8]>>( &self, entity_id: Id, entities: &[EntityKind], ) -> Result<Cursor, StorageError>

Source§

fn get_remote_log_cursors( &self, conversation_ids: &[&[u8]], ) -> Result<HashMap<Vec<u8>, Cursor>, StorageError>

Source§

impl<C: ConnectionExt> QueryRemoteCommitLog for DbConnection<C>

Source§

impl<C: ConnectionExt> QueryServerConfiguration for DbConnection<C>

Source§

fn server_configuration( &self, ) -> Result<Option<StoredServerConfiguration>, StorageError>

The stored copy, or None when this database has never held one.
Source§

fn store_server_configuration( &self, identifier: &str, backend_url: &str, response: &[u8], fetched_at_ns: i64, ) -> Result<(), StorageError>

Write the copy whole: identifier, URL, response, and fetch time. Never touches conflicting_identifier, so a matching refresh cannot erase a recorded conflict (CFG-053).
Source§

fn record_server_configuration_conflict( &self, conflicting_identifier: &str, ) -> Result<(), StorageError>

Record that the deployment answered with a different identifier (CFG-051). Does nothing when no row exists yet.
Source§

impl<C: ConnectionExt> QueryTasks for DbConnection<C>

Source§

fn create_task(&self, task: NewTask) -> Result<Task, StorageError>

Source§

fn create_or_ignore_task(&self, task: NewTask) -> Result<(), StorageError>

Idempotent enqueue: a payload-identical duplicate is a no-op (the existing row wins; OR IGNORE swallows any constraint hit, not just data_hash UNIQUE).
Source§

fn pull_in_task_deadline( &self, target_data_hash: &TaskDataHash, at_ns: i64, ) -> Result<bool, StorageError>

Lower a task’s next_attempt_at_ns to MIN(current, at_ns) — never raises. Returns whether a row matched; a missing target is a no-op (false). TaskWorker dispatch thread only (sole rescheduler).
Source§

fn get_tasks(&self) -> Result<Vec<Task>, StorageError>

Source§

fn get_next_task(&self) -> Result<Option<Task>, StorageError>

Source§

fn upsert_pending_self_remove_task( &self, group_id: &GroupId, task: NewTask, ) -> Result<(), StorageError>

Ensure exactly one live ProcessPendingSelfRemove task exists for group_id. Clears only dead rows (expired / attempts-exhausted) then insert-or-ignores, so a live retrying task keeps its backoff and is never deleted out from under the TaskRunner, while a stale dead row can’t block a fresh retry via the data_hash unique constraint.
Source§

fn update_task( &self, id: i32, attempts: i32, last_attempted_at_ns: i64, next_attempt_at_ns: i64, ) -> Result<Task, StorageError>

Source§

fn delete_task(&self, id: i32) -> Result<bool, StorageError>

Source§

impl<C: ConnectionExt> ReadOnly for DbConnection<C>

Source§

impl<T, C> Store<DbConnection<C>> for Vec<T>
where T: Store<DbConnection<C>>,

Source§

type Output = ()

Source§

fn store(&self, into: &DbConnection<C>) -> Result<Self::Output, StorageError>

Auto Trait Implementations§

§

impl<C> Freeze for DbConnection<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for DbConnection<C>
where C: RefUnwindSafe,

§

impl<C> Send for DbConnection<C>
where C: Send,

§

impl<C> Sync for DbConnection<C>
where C: Sync,

§

impl<C> Unpin for DbConnection<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for DbConnection<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for DbConnection<C>
where C: UnwindSafe,

Blanket Implementations§

§

impl<T> AggregateExpressionMethods for T

§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<C> Fetch<IdentityCache> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<PendingRemove> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<StoredAssociationState> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<StoredGroup> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<StoredGroupIntent> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<StoredGroupMessage> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<StoredIdentity> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<StoredKeyStoreEntry> for C
where C: ConnectionExt,

Source§

impl<C> Fetch<UploadedTopic> for C
where C: ConnectionExt,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> IntoSql for T

§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>, T: SqlType + TypedExpressionType,

Convert self to an expression for Diesel’s query builder. Read more
§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<C> QueryDelivery for C
where C: ConnectionExt,

Source§

fn stream_database_id(&self) -> Result<[u8; 16], StorageError>

Read the database identity used to reject foreign or pre-restore cursors.
Source§

fn rotate_stream_database_id(&self) -> Result<[u8; 16], StorageError>

Rotate only under exclusive restore lifecycle access. Existing consumer tokens are fenced.
Source§

fn assign_delivery_sequence( &self, message_id: &[u8], ) -> Result<Option<u64>, StorageError>

Allocate within the transaction that makes a message deliverable. A duplicate keeps its number. An optimistic unpublished row has no number.
Source§

fn current_delivery_cursor(&self) -> Result<DeliveryCursor, StorageError>

Read the persistent allocator, not the maximum remaining message row.
Source§

fn acquire_delivery_owner( &self, now_ns: i64, until_ns: i64, ) -> Result<DeliveryOwner, StorageError>

Acquire the sole default-consumer lease at a supplied time; fail if one is active.
Source§

fn acquire_delivery_owner_with_clock( &self, lease_ns: i64, clock: impl FnOnce() -> i64, ) -> Result<DeliveryOwner, StorageError>

Read the clock after the writer is acquired, not before a possible lock wait.
Source§

fn renew_delivery_owner( &self, owner: DeliveryOwner, now_ns: i64, until_ns: i64, ) -> Result<(), StorageError>

An expired token cannot be renewed. The caller must acquire a new token.
Source§

fn renew_delivery_owner_with_clock( &self, owner: DeliveryOwner, lease_ns: i64, clock: impl FnOnce() -> i64, ) -> Result<(), StorageError>

Extend only the current, unexpired token using time read after the writer lock.
Source§

fn check_delivery_owner( &self, owner: DeliveryOwner, now_ns: i64, ) -> Result<(), StorageError>

Reject expired or replaced tokens before handing a message to the app.
Source§

fn check_delivery_owner_with_clock( &self, owner: DeliveryOwner, clock: impl FnOnce() -> i64, ) -> Result<(), StorageError>

Check ownership using fresh time after the database connection is available.
Source§

fn release_delivery_owner( &self, owner: DeliveryOwner, ) -> Result<(), StorageError>

Release this token only; a stale consumer cannot release its replacement.
Source§

fn delivery_message_is_retained( &self, message_id: &[u8], cursor: DeliveryCursor, now_ns: i64, ) -> Result<bool, StorageError>

A buffered candidate can expire or be deleted while its previous item is held.
Source§

fn default_delivery_messages( &self, owner: DeliveryOwner, scope: &DeliveryScope, now_ns: i64, limit: u32, ) -> Result<Vec<DeliveryMessage>, StorageError>

Read retained candidates above each group’s default position. The caller applies consent/type filters and acknowledges scanned rows by the same owner.
Source§

fn default_delivery_messages_bounded( &self, owner: DeliveryOwner, scope: &DeliveryScope, now_ns: i64, limit: u32, max_bytes: u64, ) -> Result<Vec<DeliveryMessage>, StorageError>

Bound rows and bytes before loading message bodies; this read never advances D.
Source§

fn replay_delivery_messages( &self, after: DeliveryCursor, scope: &DeliveryScope, now_ns: i64, limit: u32, ) -> Result<Vec<DeliveryMessage>, StorageError>

Explicit replay does not read or write default delivery positions.
Source§

fn replay_delivery_messages_bounded( &self, after: DeliveryCursor, scope: &DeliveryScope, now_ns: i64, limit: u32, max_bytes: u64, ) -> Result<Vec<DeliveryMessage>, StorageError>

Read a bounded retained prefix strictly after the cursor, without an owner or D writes.
Source§

fn delivery_history_snapshot( &self, scope: &DeliveryScope, now_ns: i64, limit: u32, ) -> Result<DeliverySnapshot, StorageError>

Return recent retained history and a cursor from the same database snapshot.
Source§

fn delivery_history_snapshot_bounded( &self, scope: &DeliveryScope, now_ns: i64, limit: u32, max_bytes: u64, ) -> Result<DeliverySnapshot, StorageError>

Bound history allocation while capturing its resume cursor in the same snapshot.
Source§

fn delivery_history_snapshot_filtered( &self, scope: &DeliveryScope, filter: &DeliveryFilter, now_ns: i64, limit: u32, max_bytes: u64, ) -> Result<DeliverySnapshot, StorageError>

Apply history filters before its limit, with history and cursor in one read transaction.
Source§

fn acknowledge_delivery( &self, owner: DeliveryOwner, group_id: GroupId, cursor: DeliveryCursor, now_ns: i64, ) -> Result<(), StorageError>

Acknowledge after callback return or the next iterator request, never on queue insertion. This also fences progress for rows excluded by a consent/type filter.
Source§

fn acknowledge_delivery_with_clock( &self, owner: DeliveryOwner, group_id: GroupId, cursor: DeliveryCursor, clock: impl FnOnce() -> i64, ) -> Result<(), StorageError>

Advance this group’s D only after a fresh owner check under the state writer.
Source§

impl<C> QueryIncomingEnvelope for C
where C: ConnectionExt,

Source§

fn record_welcome_discovery( &self, group_id: GroupId, welcome_cursor: Cursor, ) -> Result<(), StorageError>

Record the first successful Welcome installation inside its state transaction. Rejoin does not change discovery. Local creation and history import do not call this.
Source§

fn group_ids_discovered_through( &self, target: Cursor, ) -> Result<Vec<GroupId>, StorageError>

Groups first discovered through the fixed own-installation Welcome target. Later joins and local/imported groups cannot expand this captured discovery set.
Source§

fn record_terminal_rejection( &self, topic: &StreamTopic, sequence: Cursor, code: &'static str, ) -> Result<(), StorageError>

Keep one rejection diagnostic per topic, replacing it with a later rejection. Store a stable error code, never an input payload or a formatted error message. The caller records this inside the same state transaction that deletes the pending row.
Source§

fn read_last_rejection( &self, topic: &StreamTopic, ) -> Result<Option<TerminalRejection>, StorageError>

Read the topic’s last committed rejection code without loading envelope data.
Source§

fn admit_ordered_batch( &self, topic: &StreamTopic, after: Cursor, envelopes: &[NewIncomingEnvelope], limits: IncomingLimits, ) -> Result<AdmissionResult, StorageError>

Commit the complete ordered batch and its received position together. An overlap is safe; a gap before the source cursor is rejected. Validation, capacity, or storage failure leaves both F and pending rows unchanged.
Source§

fn topic_progress( &self, topic: &StreamTopic, ) -> Result<TopicProgress, StorageError>

Read P and F from the same row; an unseen topic starts at zero.
Source§

fn first_pending_envelope( &self, topic: &StreamTopic, ) -> Result<Option<StoredIncomingEnvelope>, StorageError>

Read the next actual ID. Missing integer IDs are not queue entries.
Source§

fn pending_envelope( &self, topic: &StreamTopic, sequence: Cursor, ) -> Result<Option<StoredIncomingEnvelope>, StorageError>

Recheck one independent welcome under the caller’s state transaction.
Source§

fn pending_states_through( &self, topic: &StreamTopic, target: Cursor, ) -> Result<Vec<PendingEnvelopeState>, StorageError>

Read actual pending IDs through the fixed target without loading ciphertext. Topic and kind admission limits bound the number of stored rows returned here.
Source§

fn complete_pending_envelope( &self, topic: &StreamTopic, sequence: Cursor, ) -> Result<bool, StorageError>

Complete only the current group or identity head. Welcomes are independent. Call this inside the state transaction that applies or rejects the envelope. Deletion and P advance commit together; an unresolved Welcome keeps its prefix open.
Source§

fn set_incoming_retry( &self, topic: &StreamTopic, sequence: Cursor, retry: &IncomingRetry, ) -> Result<bool, StorageError>

Retry metadata is written only while this work is still current.
Source§

fn ready_welcomes( &self, now_ns: i64, limit: u32, ) -> Result<Vec<StoredIncomingEnvelope>, StorageError>

Read due, unblocked Welcome rows. Production callers must also set a byte bound.
Source§

fn ready_welcomes_bounded( &self, now_ns: i64, limit: u32, max_bytes: u64, ) -> Result<Vec<StoredIncomingEnvelope>, StorageError>

Read a due prefix without loading envelope bytes above the batch budget. Permanently blocked rows require a new coordinator generation, not a timer retry.
Source§

fn blocked_welcomes_bounded( &self, topic: &StreamTopic, after: Cursor, limit: u32, max_bytes: u64, ) -> Result<Vec<StoredIncomingEnvelope>, StorageError>

Read one bounded page for a new coordinator generation to recheck unsupported work.
Source§

fn welcome_barrier_complete( &self, topic: &StreamTopic, target: Cursor, ) -> Result<bool, StorageError>

Later welcome success cannot hide an earlier unresolved welcome.
Source§

fn has_pending_welcomes(&self) -> Result<bool, StorageError>

Keep welcome private keys while any unresolved welcome can still need them.
Source§

fn install_group_anchor( &self, group_id: GroupId, anchor: Cursor, mode: JoinAnchorMode, ) -> Result<(), StorageError>

Install a validated join anchor without rewinding either durable position. The caller must check the group state and install MLS state in the same transaction.
Source§

fn pending_topic_usage( &self, kind: NetworkEntityKind, ) -> Result<Vec<PendingTopicUsage>, StorageError>

Largest queues come first; empty topics are absent and must not be paused.
Source§

impl<C> QueryPreparedEnvelope for C
where C: ConnectionExt,

Source§

fn prepared_envelopes( &self, intent_id: ID, ) -> Result<Option<Vec<u8>>, StorageError>

Read the persisted attempt. None means no attempt is currently prepared.
Source§

fn compare_and_set_prepared_envelopes( &self, intent_id: ID, expected: Option<&[u8]>, replacement: Option<&[u8]>, ) -> Result<bool, StorageError>

Replace only the exact attempt the caller read under the state writer. Late publish replies must use this check before attaching receipt metadata.
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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WindowExpressionMethods for T

§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DbQuery for T

Source§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,