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 TxMode<'tx>, auth: AuthCtx ) -> Self
Trait Implementations§
source§impl ProgramVm for DbProgram<'_, '_>
impl ProgramVm for DbProgram<'_, '_>
fn address(&self) -> Option<Address>
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§
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