Back Dispatch
Acyclic back-button coordinators with reports and registrations.
BackDispatcher coordinates one navigator plus nested descendants as an
acyclic graph; the widget BackButtonDispatcher is the retained
boundary variant (NavigationBackButtonDispatcher alias).
use incular::prelude::*;
fn main() {
let dispatcher = BackDispatcher::new(Navigator::new());
let report = dispatcher.dispatch_back();
println!(
"handled: {}, depth: {}, blocked: {}",
report.handled, report.depth, report.blocked
);
}BackButtonListener::new(child) with on_back_button_pressed,
dispatcher, and register binds retained widget boundaries; dropping the
BackRegistration unregisters.
BackDispatchReport (nav): { handled, depth, blocked }.
Widget report adds pop: Option<PopAttempt>; PopAttempt: popped(result) /
rejected() / blocked() / unhandled(). BackHandlerResult: handled() /
unhandled() / from_pop(pop). BackRegistration owns retained
registrations. App-shell RootBackButtonDispatcher: add_callback(f) →
BackCallbackSubscription, dispatch_back() -> bool.