From 090b50a13f0d07ae722dd9fe6ef064cd893ff6ec Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 24 Oct 2019 14:31:53 -0400 Subject: add a method to get the input object back --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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 Process { 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 Process { -- cgit v1.2.3-54-g00ecf