pub struct ExecutionContext {
pub database_identity: Identity,
pub reducer: Option<ReducerContext>,
pub workload: WorkloadType,
}Expand description
Represents the context under which a database runtime method is executed. In particular it provides details about the currently executing txn to runtime operations. More generally it acts as a container for information that database operations may require to function correctly.
Fields§
§database_identity: IdentityThe identity of the database on which a transaction is being executed.
reducer: Option<ReducerContext>The reducer from which the current transaction originated.
workload: WorkloadTypeThe type of workload that is being executed.
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn database_identity(&self) -> Identity
pub fn database_identity(&self) -> Identity
Returns the identity of the database on which we are operating.
Sourcepub fn reducer_name(&self) -> &str
pub fn reducer_name(&self) -> &str
If this is a reducer context, returns the name of the reducer.
Sourcepub fn into_reducer_name(self) -> String
pub fn into_reducer_name(self) -> String
If this is a reducer context, returns the name of the reducer.
Sourcepub fn reducer_context(&self) -> Option<&ReducerContext>
pub fn reducer_context(&self) -> Option<&ReducerContext>
If this is a reducer context, returns the full reducer metadata.
Sourcepub fn workload(&self) -> WorkloadType
pub fn workload(&self) -> WorkloadType
Returns the type of workload that is being executed.
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§fn clone(&self) -> ExecutionContext
fn clone(&self) -> ExecutionContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for ExecutionContext
impl RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnwindSafe for ExecutionContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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