cursive-split-panel 0.0.6

Split panel for the Cursive TUI library
Documentation
use cursive::event::*;

//
// AfterEventResult
//

/// Chains event results while making sure to process all callbacks.
pub trait EventResultAfter {
    /// Chains event results while making sure to process all callbacks.
    fn after(self, prior: Self) -> Self;
}

impl EventResultAfter for EventResult {
    fn after(self, prior: Self) -> Self {
        match (prior, self) {
            (Self::Consumed(Some(first)), Self::Consumed(Some(second))) => Self::with_cb_once(move |cursive| {
                first(cursive);
                second(cursive);
            }),

            (first @ Self::Consumed(Some(_)), _) => first,

            (_, second) => second,
        }
    }
}