pub struct ScriptedHookExecutor { /* private fields */ }Expand description
In-memory scripted hook executor fixture for SDK conformance tests. Use it to script deterministic behavior in memory; any transcript or endpoint mutation is documented on the method that performs it.
Implementations§
Source§impl ScriptedHookExecutor
impl ScriptedHookExecutor
Sourcepub fn new(
executor_ref: impl Into<String>,
outcomes: impl IntoIterator<Item = Result<HookExecutionOutcome, AgentError>>,
) -> Self
pub fn new( executor_ref: impl Into<String>, outcomes: impl IntoIterator<Item = Result<HookExecutionOutcome, AgentError>>, ) -> Self
Creates a new testing::hooks value with explicit caller-provided inputs. This constructor is data-only and performs no I/O or external side effects.
Sourcepub fn once(
executor_ref: impl Into<String>,
response: HookResponse,
elapsed_ms: u64,
) -> Self
pub fn once( executor_ref: impl Into<String>, response: HookResponse, elapsed_ms: u64, ) -> Self
Builds the once value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn invocations(&self) -> Vec<HookInput>
pub fn invocations(&self) -> Vec<HookInput>
Returns the invocations currently held by this value. This configures deterministic in-memory test state only.
Trait Implementations§
Source§impl Clone for ScriptedHookExecutor
impl Clone for ScriptedHookExecutor
Source§fn clone(&self) -> ScriptedHookExecutor
fn clone(&self) -> ScriptedHookExecutor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScriptedHookExecutor
impl Debug for ScriptedHookExecutor
Source§impl HookExecutor for ScriptedHookExecutor
impl HookExecutor for ScriptedHookExecutor
Source§fn executor_ref(&self) -> &HookExecutorRef
fn executor_ref(&self) -> &HookExecutorRef
Returns executor ref for the current value.
This is a read-only or data-construction helper unless the method body explicitly calls
a port or store.
Source§fn invoke(&self, input: HookInput) -> Result<HookExecutionOutcome, AgentError>
fn invoke(&self, input: HookInput) -> Result<HookExecutionOutcome, AgentError>
Invokes one hook with the already-projected hook input.
Implementations may call hook code or transport, but runtime-owned
ordering, timeout, mutation-right checks, and journal evidence stay
outside this port call.
Auto Trait Implementations§
impl Freeze for ScriptedHookExecutor
impl RefUnwindSafe for ScriptedHookExecutor
impl Send for ScriptedHookExecutor
impl Sync for ScriptedHookExecutor
impl Unpin for ScriptedHookExecutor
impl UnsafeUnpin for ScriptedHookExecutor
impl UnwindSafe for ScriptedHookExecutor
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