pub struct EmbedderTestDouble { /* private fields */ }Expand description
Deterministic test double implementing TraverseEmbedderApi.
The double shares the production embedder’s event envelope, identifier scheme, compatible-capability lifecycle, and shutdown semantics through the same internal core; only capability execution is replaced with scripted results. It contains no business logic and never replaces runtime-owned behavior in production code paths.
Implementations§
Source§impl EmbedderTestDouble
impl EmbedderTestDouble
Sourcepub fn new(
workspace_id: impl Into<String>,
app_id: impl Into<String>,
app_version: impl Into<String>,
platform: impl Into<String>,
) -> Self
pub fn new( workspace_id: impl Into<String>, app_id: impl Into<String>, app_version: impl Into<String>, platform: impl Into<String>, ) -> Self
Creates a double with the given identity, no scripted targets, and no compatible capabilities.
Sourcepub fn with_target_output(
self,
target_id: impl Into<String>,
output: Value,
) -> Self
pub fn with_target_output( self, target_id: impl Into<String>, output: Value, ) -> Self
Scripts submit(target_id, _) to succeed with output.
Trait Implementations§
Source§impl TraverseEmbedderApi for EmbedderTestDouble
impl TraverseEmbedderApi for EmbedderTestDouble
Source§fn submit(&mut self, target_id: &str, input: &Value) -> SubmitOutcome
fn submit(&mut self, target_id: &str, input: &Value) -> SubmitOutcome
runtime.submit: execute a bundled workflow or WASM capability.Source§fn subscribe(&mut self, callback: EventCallback)
fn subscribe(&mut self, callback: EventCallback)
runtime.subscribe: register an ordered event callback. Previously
emitted events are replayed to the new subscriber first, so late
subscribers observe the identical ordered stream.Source§fn start_compatible(
&mut self,
capability_id: &str,
input: &Value,
) -> CompatibleStartOutcome
fn start_compatible( &mut self, capability_id: &str, input: &Value, ) -> CompatibleStartOutcome
compatible.start: start a compatible-mode capability instance.Source§fn stop_compatible(
&mut self,
capability_id: &str,
instance_id: Option<&str>,
) -> CompatibleLifecycleOutcome
fn stop_compatible( &mut self, capability_id: &str, instance_id: Option<&str>, ) -> CompatibleLifecycleOutcome
compatible.stop: gracefully stop one instance (instance_id) or
every running instance of the capability (None).Source§fn kill_compatible(
&mut self,
capability_id: &str,
instance_id: Option<&str>,
) -> CompatibleLifecycleOutcome
fn kill_compatible( &mut self, capability_id: &str, instance_id: Option<&str>, ) -> CompatibleLifecycleOutcome
compatible.kill: force-terminate one instance (instance_id) or
every running instance of the capability (None).Source§fn shutdown(&mut self) -> ShutdownOutcome
fn shutdown(&mut self) -> ShutdownOutcome
runtime.shutdown: kill running compatible instances and stop
accepting operations. Idempotent.Source§fn release_evidence(&self) -> Value
fn release_evidence(&self) -> Value
Release evidence connecting this embedder to its package version,
linked runtime, conformance version, and bundle digests (spec 068
FR-008, NFR-002).
Auto Trait Implementations§
impl !RefUnwindSafe for EmbedderTestDouble
impl !Sync for EmbedderTestDouble
impl !UnwindSafe for EmbedderTestDouble
impl Freeze for EmbedderTestDouble
impl Send for EmbedderTestDouble
impl Unpin for EmbedderTestDouble
impl UnsafeUnpin for EmbedderTestDouble
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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>
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 more