Crate proc_reader [−] [src]
A std::io::Read implementation for stdout/stderr of other process.
Examples
// Create a process for reading stdout let mut child = Command::new("sh").arg("-c").arg("sleep 1; echo aaa").spawn().unwrap(); // Create ProcReader from pid let pid = Pid::from_raw(child.id() as i32); let mut reader = ProcReader::from_stdout(pid); // Wait the end of process thread::sleep(Duration::from_secs(2)); // Read from ProcReader let mut line = String::new(); let _ = reader.read_to_string(&mut line); assert_eq!( "aaa\n", line);
Structs
Error |
The Error type. |
ProcReader |
The struct |
UserRegs |
Represents all possible ptrace-accessible registers on x86_64 |
Enums
ErrorKind |
The kind of an error. |
Traits
ResultExt |
Additional methods for |
Type Definitions
Result |
Convenient wrapper around |