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: Runtime, caller_metadata: ExecutionCallerMetadata, ) -> Self
Sourcepub fn local_static(
runtime: Runtime,
caller_metadata: ExecutionCallerMetadata,
) -> Self
pub fn local_static( runtime: Runtime, caller_metadata: ExecutionCallerMetadata, ) -> Self
Creates a new local static execution context (can only be used once).
Sourcepub fn local_unbounded(
runtime: Runtime,
caller_metadata: ExecutionCallerMetadata,
) -> Self
pub fn local_unbounded( runtime: Runtime, caller_metadata: ExecutionCallerMetadata, ) -> Self
Creates a new local execution context (can be used multiple times).
Sourcepub fn local_debug(
execution_mode: ExecutionMode,
runtime: Runtime,
caller_metadata: ExecutionCallerMetadata,
) -> Self
pub fn local_debug( execution_mode: ExecutionMode, runtime: Runtime, caller_metadata: ExecutionCallerMetadata, ) -> 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: DXBWithSharedValues,
initial_stack_values: Option<Vec<ValueContainer>>,
) -> Result<Option<ValueContainer>, ExecutionError>
pub fn execute_dxb_sync( &mut self, dxb: DXBWithSharedValues, initial_stack_values: Option<Vec<ValueContainer>>, ) -> Result<Option<ValueContainer>, ExecutionError>
Executes DXB in a local execution context.
pub async fn execute_dxb( &mut self, input: DXBWithSharedValues, initial_stack_values: Option<Vec<ValueContainer>>, ) -> 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§
Source§impl AsMut<ExecutionContext> for FinalOrPersistedExecutionContext<'_>
impl AsMut<ExecutionContext> for FinalOrPersistedExecutionContext<'_>
Source§fn as_mut(&mut self) -> &mut ExecutionContext
fn as_mut(&mut self) -> &mut ExecutionContext
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<ExecutionContext> for FinalOrPersistedExecutionContext<'_>
impl AsRef<ExecutionContext> for FinalOrPersistedExecutionContext<'_>
Source§fn as_ref(&self) -> &ExecutionContext
fn as_ref(&self) -> &ExecutionContext
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Debug for ExecutionContext
impl Debug for ExecutionContext
Source§impl<'a> From<&'a mut ExecutionContext> for FinalOrPersistedExecutionContext<'a>
impl<'a> From<&'a mut ExecutionContext> for FinalOrPersistedExecutionContext<'a>
Source§fn from(context: &'a mut ExecutionContext) -> Self
fn from(context: &'a mut ExecutionContext) -> Self
Converts to this type from the input type.
Source§impl From<ExecutionContext> for FinalOrPersistedExecutionContext<'_>
impl From<ExecutionContext> for FinalOrPersistedExecutionContext<'_>
Source§fn from(context: ExecutionContext) -> Self
fn from(context: ExecutionContext) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutionContext
impl !Send for ExecutionContext
impl !Sync for ExecutionContext
impl !UnwindSafe for ExecutionContext
impl Forget for ExecutionContext
impl Freeze for ExecutionContext
impl Move for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin 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 moreSource§impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
Source§fn is_subset_of(&self, other: &U) -> bool
fn is_subset_of(&self, other: &U) -> bool
Returns whether self is a subset of type