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 sql or subscription transaction.
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) -> Option<&str>
pub fn reducer_name(&self) -> Option<&str>
Returns the name of the reducer that is being executed. Returns None if this is not a reducer context.
sourcepub fn txn_type(&self) -> TransactionType
pub fn txn_type(&self) -> TransactionType
Returns the type of transaction 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§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for T
impl<T> Upcastable for T
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn