diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-24 14:31:53 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-24 14:31:53 -0400 |
commit | 090b50a13f0d07ae722dd9fe6ef064cd893ff6ec (patch) | |
tree | 6338a69d1d8dd45a89445557c74a9f796dee155a | |
parent | 24cc5cac002f87ed501fddb8e48a2315288fdb1f (diff) | |
download | tokio-pty-process-stream-090b50a13f0d07ae722dd9fe6ef064cd893ff6ec.tar.gz tokio-pty-process-stream-090b50a13f0d07ae722dd9fe6ef064cd893ff6ec.zip |
add a method to get the input object back
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -278,6 +278,15 @@ impl<R: tokio::io::AsyncRead + 'static> Process<R> { pub fn resize(&mut self, rows: u16, cols: u16) { self.needs_resize = Some((rows, cols)); } + + /// Returns a mutable reference to the input object provided in the + /// constructor. + /// + /// This can be useful if you are driving the input manually, rather than + /// just hooking it up directly to stdin. + pub fn input(&mut self) -> &mut R { + &mut self.input + } } impl<R: tokio::io::AsyncRead + 'static> Process<R> { |