#[non_exhaustive]pub enum Input {
Null,
Bytes(Zeroizing<Vec<u8>>),
Inherit,
File(Arc<File>),
}Expand description
What the child reads on its standard input.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
The null device, so the child reads the end of its input at once.
Bytes(Zeroizing<Vec<u8>>)
These bytes, which a thread of the run writes and then closes. The thread stops early when the child closes its input.
The buffer is cleared when it drops, so a secret given to a child
does not stay in the tool’s memory after the settings are gone.
Each clone of the settings holds and clears its own copy. The
clearing covers this buffer only: it misses copies that the caller
made before and the pipe’s buffer in the kernel. Debug prints the
length alone.
Inherit
The tool’s own standard input. On Unix a child in a group of its own
that reads a terminal is stopped by SIGTTIN, so a terminal suits
only Scope::Child.
File(Arc<File>)
A file or the read end of a pipe, which a pipe becomes with
File::from(OwnedFd::from(reader)) on Unix and
File::from(OwnedHandle::from(reader)) on Windows. The child gets a duplicate that
shares the file’s position, so it reads from the current position
and moves the position that the caller and any later run see. The
caller’s File stays open.