Skip to main content

QueryTransaction

Struct QueryTransaction 

Source
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

Source

pub fn new(multi: MultiReadTransaction, single: SingleTransaction) -> Self

Creates a new active query transaction

Source

pub fn version(&self) -> CommitVersion

Get the transaction version

Source

pub fn id(&self) -> TransactionId

Get the transaction ID

Source

pub fn get(&mut self, key: &EncodedKey) -> Result<Option<MultiVersionValues>>

Get a value by key

Source

pub fn contains_key(&mut self, key: &EncodedKey) -> Result<bool>

Check if a key exists

Source

pub fn prefix(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>

Get a prefix batch

Source

pub fn prefix_rev(&mut self, prefix: &EncodedKey) -> Result<MultiVersionBatch>

Get a reverse prefix batch

Source

pub fn read_as_of_version_exclusive( &mut self, version: CommitVersion, ) -> Result<()>

Read as of version exclusive

Source

pub fn range( &self, range: EncodedKeyRange, batch_size: usize, ) -> Box<dyn Iterator<Item = Result<MultiVersionValues>> + Send + '_>

Create a streaming iterator for forward range queries.

Source

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.

Source

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.

Source

pub fn with_multi_query<F, R>(&mut self, f: F) -> Result<R>
where F: FnOnce(&mut MultiReadTransaction) -> Result<R>,

Execute a function with access to the multi query transaction. This operates within the same transaction context.

Source

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>

Source§

fn from(txn: &'a mut QueryTransaction) -> Self

Converts to this type from the input type.
Source§

impl TransactionalDictionaryChanges for QueryTransaction

Source§

impl TransactionalFlowChanges for QueryTransaction

Source§

fn find_flow(&self, _id: FlowId) -> Option<&FlowDef>

Source§

fn find_flow_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&FlowDef>

Source§

fn is_flow_deleted(&self, _id: FlowId) -> bool

Source§

fn is_flow_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool

Source§

impl TransactionalHandlerChanges for QueryTransaction

Source§

fn find_handler_by_id(&self, _id: HandlerId) -> Option<&HandlerDef>

Source§

fn find_handler_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&HandlerDef>

Source§

fn is_handler_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool

Source§

impl TransactionalMigrationChanges for QueryTransaction

Source§

impl TransactionalNamespaceChanges for QueryTransaction

Source§

impl TransactionalPolicyChanges for QueryTransaction

Source§

impl TransactionalProcedureChanges for QueryTransaction

Source§

impl TransactionalRingBufferChanges for QueryTransaction

Source§

impl TransactionalRoleChanges for QueryTransaction

Source§

impl TransactionalSeriesChanges for QueryTransaction

Source§

fn find_series(&self, _id: SeriesId) -> Option<&SeriesDef>

Source§

fn find_series_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&SeriesDef>

Source§

fn is_series_deleted(&self, _id: SeriesId) -> bool

Source§

fn is_series_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool

Source§

impl TransactionalSubscriptionChanges for QueryTransaction

Source§

impl TransactionalSumTypeChanges for QueryTransaction

Source§

fn find_sumtype(&self, _id: SumTypeId) -> Option<&SumTypeDef>

Source§

fn find_sumtype_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&SumTypeDef>

Source§

fn is_sumtype_deleted(&self, _id: SumTypeId) -> bool

Source§

fn is_sumtype_deleted_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> bool

Source§

impl TransactionalTableChanges for QueryTransaction

Source§

fn find_table(&self, _id: TableId) -> Option<&TableDef>

Source§

fn find_table_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&TableDef>

Source§

fn is_table_deleted(&self, _id: TableId) -> bool

Source§

fn is_table_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool

Source§

impl TransactionalTestChanges for QueryTransaction

Source§

fn find_test(&self, _id: TestId) -> Option<&TestDef>

Source§

fn find_test_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&TestDef>

Source§

fn is_test_deleted(&self, _id: TestId) -> bool

Source§

fn is_test_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool

Source§

impl TransactionalUserAuthenticationChanges for QueryTransaction

Source§

impl TransactionalUserChanges for QueryTransaction

Source§

impl TransactionalUserRoleChanges for QueryTransaction

Source§

fn find_user_role(&self, _user: UserId, _role: RoleId) -> Option<&UserRoleDef>

Source§

fn is_user_role_deleted(&self, _user: UserId, _role: RoleId) -> bool

Source§

impl TransactionalViewChanges for QueryTransaction

Source§

fn find_view(&self, _id: ViewId) -> Option<&ViewDef>

Source§

fn find_view_by_name( &self, _namespace: NamespaceId, _name: &str, ) -> Option<&ViewDef>

Source§

fn is_view_deleted(&self, _id: ViewId) -> bool

Source§

fn is_view_deleted_by_name(&self, _namespace: NamespaceId, _name: &str) -> bool

Source§

impl TransactionalChanges for QueryTransaction

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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