pub mod confirm;
pub mod datepicker;
pub mod editor;
pub mod event;
pub mod guard;
pub mod history;
pub mod line_edit;
pub mod number;
pub mod password;
pub mod select;
pub mod shortcut;
pub mod text;
pub mod textarea;
pub mod validate;
#[cfg(feature = "fuzzy")]
pub mod fuzzy;
pub(crate) mod field;
pub(crate) mod prompt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Outcome<T> {
Submitted(T),
Cancelled,
Shortcut(i32),
}
impl<T> Outcome<T> {
pub fn submitted(self) -> Option<T> {
match self {
Outcome::Submitted(value) => Some(value),
Outcome::Cancelled | Outcome::Shortcut(_) => None,
}
}
pub fn is_cancelled(&self) -> bool {
matches!(self, Outcome::Cancelled)
}
pub fn shortcut_id(&self) -> Option<i32> {
match self {
Outcome::Shortcut(id) => Some(*id),
_ => None,
}
}
}