Struct spacetimedb::execution_context::ExecutionContext
source · pub struct ExecutionContext<'a> { /* private fields */ }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.
Implementations§
source§impl<'a> ExecutionContext<'a>
impl<'a> ExecutionContext<'a>
sourcepub fn reducer(database: Address, name: &'a str) -> Self
pub fn reducer(database: Address, name: &'a str) -> Self
Returns an ExecutionContext for a reducer transaction.
sourcepub fn sql(database: Address) -> Self
pub fn sql(database: Address) -> Self
Returns an ExecutionContext for a one-off sql query.
sourcepub fn subscribe(database: Address) -> Self
pub fn subscribe(database: Address) -> Self
Returns an ExecutionContext for an initial subscribe call.
sourcepub fn incremental_update(database: Address) -> Self
pub fn incremental_update(database: Address) -> Self
Returns an ExecutionContext for a subscription update.
sourcepub fn internal(database: Address) -> Self
pub fn internal(database: Address) -> Self
Returns an ExecutionContext for an internal database operation.
sourcepub fn database(&self) -> Address
pub fn database(&self) -> Address
Returns the address 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 workload(&self) -> WorkloadType
pub fn workload(&self) -> WorkloadType
Returns the type of workload that is being executed.
Trait Implementations§
source§impl<'a> Default for ExecutionContext<'a>
impl<'a> Default for ExecutionContext<'a>
source§fn default() -> ExecutionContext<'a>
fn default() -> ExecutionContext<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ExecutionContext<'a>
impl<'a> Send for ExecutionContext<'a>
impl<'a> Sync for ExecutionContext<'a>
impl<'a> Unpin for ExecutionContext<'a>
impl<'a> UnwindSafe for ExecutionContext<'a>
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