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_once() -> Self
pub fn local_once() -> Self
Creates a new local execution context (can only be used once).
Sourcepub fn local_with_runtime_internal(
runtime_internal: Rc<RuntimeInternal>,
once: bool,
) -> Self
pub fn local_with_runtime_internal( runtime_internal: Rc<RuntimeInternal>, once: bool, ) -> Self
Creates a new local execution context with a runtime.
Sourcepub fn local_debug(once: bool) -> Self
pub fn local_debug(once: bool) -> 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>,
once: bool,
) -> Self
pub fn local_debug_with_runtime_internal( runtime_internal: Rc<RuntimeInternal>, once: bool, ) -> Self
Creates a new local execution context with verbose mode enabled and a runtime.
pub fn remote_once(endpoint: impl Into<Endpoint>) -> Self
pub fn remote(endpoint: impl Into<Endpoint>) -> Self
Sourcepub fn compile(
&mut self,
script: &str,
inserted_values: &[ValueContainer],
) -> Result<Vec<u8>, CompilerError>
pub fn compile( &mut self, script: &str, inserted_values: &[ValueContainer], ) -> Result<Vec<u8>, CompilerError>
Compiles a script using the compile scope of the execution context
Sourcepub fn execute_dxb_sync(
&mut self,
dxb: &[u8],
end_execution: bool,
) -> Result<Option<ValueContainer>, ExecutionError>
pub fn execute_dxb_sync( &mut self, dxb: &[u8], end_execution: bool, ) -> 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], end_execution: bool, ) -> Result<Option<ValueContainer>, ExecutionError>
pub async fn execute( &mut self, script: &str, inserted_values: &[ValueContainer], ) -> Result<Option<ValueContainer>, ScriptExecutionError>
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§fn clone(&self) -> ExecutionContext
fn clone(&self) -> ExecutionContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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