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
Sourcepub fn local_unbounded() -> Self
pub fn local_unbounded() -> Self
Creates a new local execution context (can be used multiple times).
Sourcepub fn local_with_runtime_internal(
runtime_internal: Rc<RuntimeInternal>,
execution_mode: ExecutionMode,
) -> Self
pub fn local_with_runtime_internal( runtime_internal: Rc<RuntimeInternal>, execution_mode: ExecutionMode, ) -> Self
Creates a new local execution context with a runtime.
Sourcepub fn local_debug(execution_mode: ExecutionMode) -> Self
pub fn local_debug(execution_mode: ExecutionMode) -> Self
Creates a new local execution context with verbose mode enabled, providing more log outputs for debugging purposes.
Sourcepub fn local_debug_with_runtime_internal(
runtime_internal: Rc<RuntimeInternal>,
execution_mode: ExecutionMode,
) -> Self
pub fn local_debug_with_runtime_internal( runtime_internal: Rc<RuntimeInternal>, execution_mode: ExecutionMode, ) -> Self
Creates a new local execution context with verbose mode enabled and a runtime.
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn compile(
&mut self,
script: &str,
inserted_values: &[ValueContainer],
) -> Result<Vec<u8>, SpannedCompilerError>
pub fn compile( &mut self, script: &str, inserted_values: &[ValueContainer], ) -> Result<Vec<u8>, SpannedCompilerError>
Compiles a script using the compile scope of the execution context
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.
Sourcepub fn execute_sync(
&mut self,
script: &str,
inserted_values: &[ValueContainer],
) -> Result<Option<ValueContainer>, ScriptExecutionError>
pub fn execute_sync( &mut self, script: &str, inserted_values: &[ValueContainer], ) -> Result<Option<ValueContainer>, ScriptExecutionError>
Executes a script in a local execution context.
pub async fn execute_dxb( &mut self, dxb: &[u8], ) -> Result<Option<ValueContainer>, ExecutionError>
pub async fn execute( &mut self, script: &str, inserted_values: &[ValueContainer], ) -> Result<Option<ValueContainer>, ScriptExecutionError>
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 !UnwindSafe for ExecutionContext
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
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> ⓘ
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> ⓘ
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