aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-24 14:31:53 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-24 14:31:53 -0400
commit090b50a13f0d07ae722dd9fe6ef064cd893ff6ec (patch)
tree6338a69d1d8dd45a89445557c74a9f796dee155a
parent24cc5cac002f87ed501fddb8e48a2315288fdb1f (diff)
downloadtokio-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.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2c5aafb..2e21f01 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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> {