pub struct QueryTransaction { /* private fields */ }Expand description
An active query transaction that holds a multi query transaction and provides query-only access to single storage.
Implementations§
Source§impl QueryTransaction
impl QueryTransaction
Sourcepub fn new(multi: MultiReadTransaction, single: SingleTransaction) -> Self
pub fn new(multi: MultiReadTransaction, single: SingleTransaction) -> Self
Creates a new active query transaction
Sourcepub fn version(&self) -> CommitVersion
pub fn version(&self) -> CommitVersion
Get the transaction version
Sourcepub fn id(&self) -> TransactionId
pub fn id(&self) -> TransactionId
Get the transaction ID
Sourcepub fn get(&mut self, key: &EncodedKey) -> Result<Option<MultiVersionValues>>
pub fn get(&mut self, key: &EncodedKey) -> Result<Option<MultiVersionValues>>
Get a value by key
Sourcepub fn contains_key(&mut self, key: &EncodedKey) -> Result<bool>
pub fn contains_key(&mut self, key: &EncodedKey) -> Result<bool>
Check if a key exists
Sourcepub fn prefix(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
pub fn prefix(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
Get a prefix batch
Sourcepub fn prefix_rev(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
pub fn prefix_rev(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>
Get a reverse prefix batch
Sourcepub fn read_as_of_version_exclusive(
&mut self,
version: CommitVersion,
) -> Result<()>
pub fn read_as_of_version_exclusive( &mut self, version: CommitVersion, ) -> Result<()>
Read as of version exclusive
Sourcepub fn range(
&self,
range: EncodedKeyRange,
batch_size: usize,
) -> Box<dyn Iterator<Item = Result<MultiVersionValues>> + Send + '_>
pub fn range( &self, range: EncodedKeyRange, batch_size: usize, ) -> Box<dyn Iterator<Item = Result<MultiVersionValues>> + Send + '_>
Create a streaming iterator for forward range queries.
Sourcepub fn range_rev(
&self,
range: EncodedKeyRange,
batch_size: usize,
) -> Box<dyn Iterator<Item = Result<MultiVersionValues>> + Send + '_>
pub fn range_rev( &self, range: EncodedKeyRange, batch_size: usize, ) -> Box<dyn Iterator<Item = Result<MultiVersionValues>> + Send + '_>
Create a streaming iterator for reverse range queries.
Sourcepub fn with_single_query<'a, I, F, R>(&self, keys: I, f: F) -> Result<R>where
I: IntoIterator<Item = &'a EncodedKey> + Send,
F: FnOnce(&mut SingleReadTransaction<'_>) -> Result<R> + Send,
R: Send,
pub fn with_single_query<'a, I, F, R>(&self, keys: I, f: F) -> Result<R>where
I: IntoIterator<Item = &'a EncodedKey> + Send,
F: FnOnce(&mut SingleReadTransaction<'_>) -> Result<R> + Send,
R: Send,
Execute a function with query access to the single transaction.
Sourcepub fn with_multi_query<F, R>(&mut self, f: F) -> Result<R>
pub fn with_multi_query<F, R>(&mut self, f: F) -> Result<R>
Execute a function with access to the multi query transaction. This operates within the same transaction context.
Sourcepub fn begin_single_query<'a, I>(
&self,
keys: I,
) -> Result<SingleReadTransaction<'_>>where
I: IntoIterator<Item = &'a EncodedKey>,
pub fn begin_single_query<'a, I>(
&self,
keys: I,
) -> Result<SingleReadTransaction<'_>>where
I: IntoIterator<Item = &'a EncodedKey>,
Begin a single-version query transaction for specific keys
Trait Implementations§
Source§impl<'a> From<&'a mut QueryTransaction> for Transaction<'a>
impl<'a> From<&'a mut QueryTransaction> for Transaction<'a>
Source§fn from(txn: &'a mut QueryTransaction) -> Self
fn from(txn: &'a mut QueryTransaction) -> Self
Converts to this type from the input type.
Source§impl TransactionalDictionaryChanges for QueryTransaction
impl TransactionalDictionaryChanges for QueryTransaction
fn find_dictionary(&self, _id: DictionaryId) -> Option<&DictionaryDef>
fn find_dictionary_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&DictionaryDef>
fn is_dictionary_deleted(&self, _id: DictionaryId) -> bool
fn is_dictionary_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalFlowChanges for QueryTransaction
impl TransactionalFlowChanges for QueryTransaction
fn find_flow(&self, _id: FlowId) -> Option<&FlowDef>
fn find_flow_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&FlowDef>
fn is_flow_deleted(&self, _id: FlowId) -> bool
fn is_flow_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
Source§impl TransactionalHandlerChanges for QueryTransaction
impl TransactionalHandlerChanges for QueryTransaction
fn find_handler_by_id(&self, _id: HandlerId) -> Option<&HandlerDef>
fn find_handler_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&HandlerDef>
fn is_handler_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalMigrationChanges for QueryTransaction
impl TransactionalMigrationChanges for QueryTransaction
fn find_migration(&self, _id: MigrationId) -> Option<&MigrationDef>
fn find_migration_by_name(&self, _name: &str) -> Option<&MigrationDef>
fn is_migration_deleted(&self, _id: MigrationId) -> bool
fn is_migration_deleted_by_name(&self, _name: &str) -> bool
Source§impl TransactionalNamespaceChanges for QueryTransaction
impl TransactionalNamespaceChanges for QueryTransaction
fn find_namespace(&self, _id: NamespaceId) -> Option<&Namespace>
fn find_namespace_by_name(&self, _name: &str) -> Option<&Namespace>
fn is_namespace_deleted(&self, _id: NamespaceId) -> bool
fn is_namespace_deleted_by_name(&self, _name: &str) -> bool
Source§impl TransactionalProcedureChanges for QueryTransaction
impl TransactionalProcedureChanges for QueryTransaction
fn find_procedure(&self, _id: ProcedureId) -> Option<&ProcedureDef>
fn find_procedure_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&ProcedureDef>
fn is_procedure_deleted(&self, _id: ProcedureId) -> bool
fn is_procedure_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalRingBufferChanges for QueryTransaction
impl TransactionalRingBufferChanges for QueryTransaction
fn find_ringbuffer(&self, _id: RingBufferId) -> Option<&RingBufferDef>
fn find_ringbuffer_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&RingBufferDef>
fn is_ringbuffer_deleted(&self, _id: RingBufferId) -> bool
fn is_ringbuffer_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalSeriesChanges for QueryTransaction
impl TransactionalSeriesChanges for QueryTransaction
fn find_series(&self, _id: SeriesId) -> Option<&SeriesDef>
fn find_series_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&SeriesDef>
fn is_series_deleted(&self, _id: SeriesId) -> bool
fn is_series_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalSubscriptionChanges for QueryTransaction
impl TransactionalSubscriptionChanges for QueryTransaction
fn find_subscription(&self, _id: SubscriptionId) -> Option<&SubscriptionDef>
fn is_subscription_deleted(&self, _id: SubscriptionId) -> bool
Source§impl TransactionalSumTypeChanges for QueryTransaction
impl TransactionalSumTypeChanges for QueryTransaction
fn find_sumtype(&self, _id: SumTypeId) -> Option<&SumTypeDef>
fn find_sumtype_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&SumTypeDef>
fn is_sumtype_deleted(&self, _id: SumTypeId) -> bool
fn is_sumtype_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool
Source§impl TransactionalTableChanges for QueryTransaction
impl TransactionalTableChanges for QueryTransaction
fn find_table(&self, _id: TableId) -> Option<&TableDef>
fn find_table_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&TableDef>
fn is_table_deleted(&self, _id: TableId) -> bool
fn is_table_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
Source§impl TransactionalTestChanges for QueryTransaction
impl TransactionalTestChanges for QueryTransaction
fn find_test(&self, _id: TestId) -> Option<&TestDef>
fn find_test_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&TestDef>
fn is_test_deleted(&self, _id: TestId) -> bool
fn is_test_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
Source§impl TransactionalUserAuthenticationChanges for QueryTransaction
impl TransactionalUserAuthenticationChanges for QueryTransaction
fn find_user_authentication( &self, _id: UserAuthenticationId, ) -> Option<&UserAuthenticationDef>
fn find_user_authentication_by_user_and_method( &self, _user_id: UserId, _method: &str, ) -> Option<&UserAuthenticationDef>
fn is_user_authentication_deleted(&self, _id: UserAuthenticationId) -> bool
Source§impl TransactionalUserRoleChanges for QueryTransaction
impl TransactionalUserRoleChanges for QueryTransaction
fn find_user_role(&self, _user: UserId, _role: RoleId) -> Option<&UserRoleDef>
fn is_user_role_deleted(&self, _user: UserId, _role: RoleId) -> bool
Source§impl TransactionalViewChanges for QueryTransaction
impl TransactionalViewChanges for QueryTransaction
fn find_view(&self, _id: ViewId) -> Option<&ViewDef>
fn find_view_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&ViewDef>
fn is_view_deleted(&self, _id: ViewId) -> bool
fn is_view_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool
impl TransactionalChanges for QueryTransaction
Auto Trait Implementations§
impl Freeze for QueryTransaction
impl !RefUnwindSafe for QueryTransaction
impl Send for QueryTransaction
impl Sync for QueryTransaction
impl Unpin for QueryTransaction
impl UnsafeUnpin for QueryTransaction
impl !UnwindSafe for QueryTransaction
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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