pub enum Input {
Ignored,
AsyncRead(Box<dyn AsyncRead + Send + Sync + Unpin>),
Jsonl(JsonlStream),
}Expand description
The source of bytes to supply to a child’s stdin.
Program wrappers configure the child’s stdin from this value and feed the resulting pipe during execution. Graph-output runners transfer ownership of their input into the returned stream. Buffered runners consume it in place. Repeated executions never replay bytes that have already been read. Early exit or cancellation can leave input partially consumed, including a partly written record; reusing it does not guarantee record-boundary resumption.
With std enabled, conversion to Stdio only selects null or piped stdin;
it does not transfer bytes. The consuming conversion also drops any stored
reader or batch stream. Use Input::as_stdio to preserve the source for execution.
Variants§
Ignored
Supplies no bytes by configuring stdin to read from the null device.
AsyncRead(Box<dyn AsyncRead + Send + Sync + Unpin>)
Supplies bytes from an owned asynchronous reader through a stdin pipe.
The reader must support use across asynchronous tasks (Send + Sync)
and unpinned I/O (Unpin). Its contents are omitted from debug output.
Jsonl(JsonlStream)
std only.Supplies JSONL batches, applying backpressure and propagating source errors. Contiguous terminated batches are written directly; fragmented batches use bounded vectored I/O when supported, or a reusable copy buffer. Batch boundaries are not encoded on the wire. Empty batches are ignored. Existing line endings are preserved; an LF is appended to any line that does not end in LF so adjacent records cannot run together. An empty line therefore writes a blank line. Line constructors enforce framing; UTF-8, JSON, and RDF mapping profiles are not validated here.
Implementations§
Source§impl Input
impl Input
Sourcepub fn into_jsonl(self) -> Self
Available on crate feature std only.
pub fn into_jsonl(self) -> Self
std only.Adapts byte input to batched JSONL input using default thresholds.
Wraps AsyncRead using crate::jsonl_batches; other
variants are returned unchanged. Adaptation is lazy and performs no I/O.
When fed to a child, a final unterminated line gains an LF as described
by Jsonl.
Sourcepub fn into_jsonl_with_batching(self, options: BatchOptions) -> Self
Available on crate feature std only.
pub fn into_jsonl_with_batching(self, options: BatchOptions) -> Self
std only.Adapts an asynchronous reader into JSONL batches with the supplied policy.
Existing batch streams and ignored input are returned unchanged. To rebatch
a stream, combine crate::flatten_batches and crate::batch_lines.