Struct spacetimedb::vm::DbProgram
source · pub struct DbProgram<'db, 'tx> { /* private fields */ }Expand description
A ProgramVm implementation that carry a RelationalDB for it query execution
Implementations§
source§impl<'db, 'tx> DbProgram<'db, 'tx>
impl<'db, 'tx> DbProgram<'db, 'tx>
pub fn new( ctx: &'tx ExecutionContext<'_>, db: &'db RelationalDB, tx: &'tx mut MutTxId, auth: AuthCtx ) -> Self
Trait Implementations§
source§impl ProgramVm for DbProgram<'_, '_>
impl ProgramVm for DbProgram<'_, '_>
fn env(&self) -> &EnvDb
fn env_mut(&mut self) -> &mut EnvDb
fn ctx(&self) -> &dyn ProgramVm
fn auth(&self) -> &AuthCtx
source§fn eval_query(&mut self, query: CrudCode) -> Result<Code, ErrorVm>
fn eval_query(&mut self, query: CrudCode) -> Result<Code, ErrorVm>
Allows to execute the query with the state carried by the implementation of this
trait
fn as_program_ref(&self) -> ProgramRef<'_>
source§fn load_ops(env: &mut EnvDb)where
Self: Sized,
fn load_ops(env: &mut EnvDb)where
Self: Sized,
Load the in-built functions that define the operators of the VM,
like
+, and, ==, etc.source§fn add_lambda(&mut self, f: FunDef, body: Code)
fn add_lambda(&mut self, f: FunDef, body: Code)
Add a
function that is defined natively by Codefn update_lambda(&mut self, f: FunDef, body: Code)
Auto Trait Implementations§
impl<'db, 'tx> !RefUnwindSafe for DbProgram<'db, 'tx>
impl<'db, 'tx> !Send for DbProgram<'db, 'tx>
impl<'db, 'tx> !Sync for DbProgram<'db, 'tx>
impl<'db, 'tx> Unpin for DbProgram<'db, 'tx>
impl<'db, 'tx> !UnwindSafe for DbProgram<'db, 'tx>
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.