pub enum ExecutionContext {
Local(LocalExecutionContext),
Remote(RemoteExecutionContext),
}Expand description
An execution context holds the persistent state for executing multiple scripts sequentially within the same context. This can be either a local context, which is used for executing scripts in the same process, or a remote context, which is used for executing scripts on a remote endpoint.
Variants§
Local(LocalExecutionContext)
Remote(RemoteExecutionContext)
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
pub fn local( execution_mode: ExecutionMode, runtime: Rc<RuntimeInternal>, ) -> Self
Sourcepub fn local_static(runtime: Rc<RuntimeInternal>) -> Self
pub fn local_static(runtime: Rc<RuntimeInternal>) -> Self
Creates a new local static execution context (can only be used once).
Sourcepub fn local_unbounded(runtime: Rc<RuntimeInternal>) -> Self
pub fn local_unbounded(runtime: Rc<RuntimeInternal>) -> Self
Creates a new local execution context (can be used multiple times).
Sourcepub fn local_debug(
execution_mode: ExecutionMode,
runtime: Rc<RuntimeInternal>,
) -> Self
pub fn local_debug( execution_mode: ExecutionMode, runtime: Rc<RuntimeInternal>, ) -> Self
Creates a new local execution context with verbose mode enabled, providing more log outputs for debugging purposes.
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn execute_dxb_sync(
&mut self,
dxb: &[u8],
) -> Result<Option<ValueContainer>, ExecutionError>
pub fn execute_dxb_sync( &mut self, dxb: &[u8], ) -> Result<Option<ValueContainer>, ExecutionError>
Executes DXB in a local execution context.
pub async fn execute_dxb( &mut self, dxb: &[u8], ) -> Result<Option<ValueContainer>, ExecutionError>
Sourcepub fn memory_dump(&self) -> Option<MemoryDump>
pub fn memory_dump(&self) -> Option<MemoryDump>
Returns a memory dump of the current state of the execution context if available.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExecutionContext
impl !RefUnwindSafe for ExecutionContext
impl !Send for ExecutionContext
impl !Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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