pub struct ScriptedAdapter { /* private fields */ }Expand description
A scripted adapter on a thread (the reference’s fake-adapter.mjs): it
writes every leading In line, then for each Out entry waits for one
request line from the engine (recording it) before playing the In lines
that follow. It stays alive until the engine closes its end, then returns
the request lines it received.
Implementations§
Source§impl ScriptedAdapter
impl ScriptedAdapter
Sourcepub fn spawn(transcript: Vec<(Dir, String)>) -> (Self, PipeReader, PipeWriter)
pub fn spawn(transcript: Vec<(Dir, String)>) -> (Self, PipeReader, PipeWriter)
Spawn over a fresh pipe pair; returns the adapter and the engine’s
ends (from_adapter, to_adapter) for crate::ExternalSource::connect.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ScriptedAdapter
impl !UnwindSafe for ScriptedAdapter
impl Freeze for ScriptedAdapter
impl Send for ScriptedAdapter
impl Sync for ScriptedAdapter
impl Unpin for ScriptedAdapter
impl UnsafeUnpin for ScriptedAdapter
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