pub struct JsonInvocationStrategy { /* private fields */ }Expand description
Strategy that marshals inputs/outputs via JSON helpers.
When targeting Python, the strategy injects a temporary global containing the JSON-decoded payload. For JavaScript the payload is published to the bootstrap so the handler receives a deserialised value via the descriptor.
Implementations§
Trait Implementations§
Source§impl Default for JsonInvocationStrategy
impl Default for JsonInvocationStrategy
Source§fn default() -> JsonInvocationStrategy
fn default() -> JsonInvocationStrategy
Returns the “default value” for a type. Read more
Source§impl PyInvocationStrategy for JsonInvocationStrategy
impl PyInvocationStrategy for JsonInvocationStrategy
Source§fn pre_execute_js(&mut self, ctx: &mut InvocationContext<'_>) -> Result<()>
fn pre_execute_js(&mut self, ctx: &mut InvocationContext<'_>) -> Result<()>
Hook executed before any Python code runs, while JS context is active.
Source§fn pre_execute_py(&mut self, ctx: &mut InvocationContext<'_>) -> Result<()>
fn pre_execute_py(&mut self, ctx: &mut InvocationContext<'_>) -> Result<()>
Hook executed inside the Python interpreter before the user entrypoint.
Source§fn invoke(&mut self, ctx: &mut InvocationContext<'_>) -> Result<StrategyResult>
fn invoke(&mut self, ctx: &mut InvocationContext<'_>) -> Result<StrategyResult>
Executes the user entrypoint and returns the raw execution output.
Source§fn post_execute_py(
&mut self,
_ctx: &mut InvocationContext<'_>,
_result: &StrategyResult,
) -> Result<()>
fn post_execute_py( &mut self, _ctx: &mut InvocationContext<'_>, _result: &StrategyResult, ) -> Result<()>
Hook executed after the entrypoint inside Python.
Source§fn post_execute_js(
&mut self,
_ctx: &mut InvocationContext<'_>,
_result: &StrategyResult,
) -> Result<()>
fn post_execute_js( &mut self, _ctx: &mut InvocationContext<'_>, _result: &StrategyResult, ) -> Result<()>
Hook executed after the entrypoint inside JS.
Auto Trait Implementations§
impl Freeze for JsonInvocationStrategy
impl RefUnwindSafe for JsonInvocationStrategy
impl Send for JsonInvocationStrategy
impl Sync for JsonInvocationStrategy
impl Unpin for JsonInvocationStrategy
impl UnwindSafe for JsonInvocationStrategy
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