From 8579ee86981d7c9b960c14ef36ad4c3e17bcbeb8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 27 Oct 2019 15:44:33 -0400 Subject: docs --- src/resize.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/resize.rs b/src/resize.rs index 5b59f9e..828e128 100644 --- a/src/resize.rs +++ b/src/resize.rs @@ -2,6 +2,11 @@ use futures::future::Future as _; use futures::stream::Stream as _; use snafu::futures01::StreamExt as _; +/// A wrapper around `Process` which listens for terminal resize signals and +/// propagates the changes into the process running on the pty. +/// +/// This is useful for running subprocesses in a pty that will ultimately be +/// displayed in the user's terminal directly. pub struct ResizingProcess { process: crate::process::Process, resizer: Box< @@ -13,6 +18,8 @@ pub struct ResizingProcess { } impl ResizingProcess { + /// Creates a new `ResizingProcess` as a wrapper around the given + /// `Process` instance. pub fn new(process: crate::process::Process) -> Self { Self { process, @@ -24,6 +31,8 @@ impl ResizingProcess { } } + /// Returns a mutable reference to the input object provided in the inner + /// `Process` instance's constructor. pub fn input(&mut self) -> &mut R { self.process.input() } -- cgit v1.2.3