diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-13 16:52:33 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-13 17:08:19 -0500 |
commit | 616fddad3e8557d3a4248fd25d00c256eab2c827 (patch) | |
tree | dcd5bd048085c1cc0c4b7f2d2b393c711f72a4e6 /src/error.rs | |
parent | f0c07dfee8b65a36033943f888c1da5f8ec96098 (diff) | |
download | textmode-616fddad3e8557d3a4248fd25d00c256eab2c827.tar.gz textmode-616fddad3e8557d3a4248fd25d00c256eab2c827.zip |
docs
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index f2e774e..27f5bd5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,16 +1,22 @@ +/// Type for errors returned by this crate. #[derive(thiserror::Error, Debug)] pub enum Error { + /// error reading from stdin #[error("error reading from stdin")] ReadStdin(#[source] std::io::Error), + /// error enabling terminal raw mode #[error("error enabling terminal raw mode")] SetRaw(#[source] nix::Error), + /// error restoring terminal from raw mode #[error("error restoring terminal from raw mode")] UnsetRaw(#[source] nix::Error), + /// error writing to stdout #[error("error writing to stdout")] WriteStdout(#[source] std::io::Error), } +/// Convenience wrapper for a `Result` using `textmode::Error`. pub type Result<T> = std::result::Result<T, Error>; |