Skip to main content

Module pipe

Module pipe 

Source
Expand description

An in-memory pipe: a Write half that hands byte chunks to a blocking Read half over a channel. Lets a test or a conformance runner connect an crate::ExternalSource to a scripted adapter running on a thread without spawning a process. Dropping the writer is EOF for the reader.

Structs§

PipeReader
The reading end (blocks until bytes arrive or the writer is dropped).
PipeWriter
The writing end.
ScriptedAdapter
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.

Enums§

Dir
Who speaks a transcript line: the adapter (In, written to the engine) or the engine (Out, a request the adapter waits for).

Functions§

pipe
A connected (writer, reader) pair.