tty_form/
result.rs

1/// A form operation's result containing either a successful value or error.
2pub type Result<T> = std::result::Result<T, Error>;
3
4/// A failed form operation's error information.
5#[derive(Debug)]
6pub enum Error {
7    /// Form was canceled before completion.
8    Canceled,
9    /// A terminal interface error.
10    Interface(tty_interface::Error),
11    /// A low-level terminal interaction error.
12    Terminal(crossterm::ErrorKind),
13}
14
15impl From<tty_interface::Error> for Error {
16    fn from(err: tty_interface::Error) -> Self {
17        Error::Interface(err)
18    }
19}
20
21impl From<crossterm::ErrorKind> for Error {
22    fn from(err: crossterm::ErrorKind) -> Self {
23        Error::Terminal(err)
24    }
25}