pub struct AnyRoute { /* private fields */ }Expand description
Erased Route: one identity and a static vtable, the fat pointer rustc cannot build for
an arena id. No lease.
This is what a field or parameter Dart types as Route<dynamic> becomes; the route stays in
the App under its own type, and downcast gets the typed handle back.
Equality is Dart’s == on an object reference: two handles are equal exactly when they address
the same route.
Implementations§
Source§impl AnyRoute
impl AnyRoute
Source§impl AnyRoute
impl AnyRoute
Sourcepub fn downcast<T>(self, app: &App) -> Option<Handle<T>>where
T: 'static,
pub fn downcast<T>(self, app: &App) -> Option<Handle<T>>where
T: 'static,
Dart’s route as T: the typed handle when this route is a T, else None.
Sourcepub fn as_transition_route(self, app: &App) -> Option<AnyTransitionRoute>
pub fn as_transition_route(self, app: &App) -> Option<AnyTransitionRoute>
Dart’s route is TransitionRoute<dynamic>.
Sourcepub fn as_modal_route(self, app: &App) -> Option<AnyModalRoute>
pub fn as_modal_route(self, app: &App) -> Option<AnyModalRoute>
Dart’s route is ModalRoute<dynamic>.
Sourcepub fn as_page_route(self, app: &App) -> Option<AnyPageRoute>
pub fn as_page_route(self, app: &App) -> Option<AnyPageRoute>
Dart’s route is PageRoute<dynamic>.
Sourcepub fn interface<I>(self) -> Option<I>where
I: 'static,
pub fn interface<I>(self) -> Option<I>where
I: 'static,
See Route::interface: Dart’s route is SomeMixin, as
interface::<Rc<dyn SomeMixin>>().
Sourcepub fn request_focus(self, app: &App) -> bool
pub fn request_focus(self, app: &App) -> bool
When the route state is updated, request focus if the current route is at the top.
If not provided in the constructor, Navigator::request_focus is used instead.
The navigator that the route is in, if any.
Sourcepub fn settings(self, app: &App) -> RouteSettingsRef
pub fn settings(self, app: &App) -> RouteSettingsRef
The settings for this route.
The settings can change during the route’s lifetime. If the settings change, the route’s
overlays will be marked dirty (see changed_internal_state).
If the route is created from a Page in the Navigator::pages list, then this will
be a page, and it will be updated each time its corresponding page has changed.
Sourcepub fn is_page_based(self, app: &App) -> bool
pub fn is_page_based(self, app: &App) -> bool
Dart’s Route._isPageBased.
Sourcepub fn restoration_scope_id(
self,
app: &App,
) -> Handle<ValueNotifier<Option<String>>>
pub fn restoration_scope_id( self, app: &App, ) -> Handle<ValueNotifier<Option<String>>>
The restoration scope ID to be used for the RestorationScope surrounding this route.
The restoration scope ID is None if restoration is currently disabled for this route.
If the restoration scope ID changes (e.g. because restoration is enabled or disabled) during the life of the route, the notifier notifies its listeners.
Sourcepub fn popped(self, app: &App) -> CompleterFuture<Option<Rc<dyn Any>>> ⓘ
pub fn popped(self, app: &App) -> CompleterFuture<Option<Rc<dyn Any>>> ⓘ
A future that completes when this route is popped off the navigator.
The future completes with the value given to NavigatorState::pop, if any, or else
the value of current_result. See
did_complete for more discussion on this topic.
Sourcepub fn overlay_entries(self, app: &App) -> Vec<Handle<OverlayEntry>>
pub fn overlay_entries(self, app: &App) -> Vec<Handle<OverlayEntry>>
Sourcepub fn install(self, app: &mut App)
pub fn install(self, app: &mut App)
See Route::install.
Sourcepub fn did_push(self, app: &mut App) -> TickerFuture ⓘ
pub fn did_push(self, app: &mut App) -> TickerFuture ⓘ
See Route::did_push.
Sourcepub fn did_add(self, app: &mut App)
pub fn did_add(self, app: &mut App)
See Route::did_add.
Sourcepub fn did_replace(self, app: &mut App, old_route: Option<AnyRoute>)
pub fn did_replace(self, app: &mut App, old_route: Option<AnyRoute>)
See Route::did_replace.
Sourcepub fn will_pop(self, app: &mut App) -> RoutePopDisposition
pub fn will_pop(self, app: &mut App) -> RoutePopDisposition
See Route::will_pop.
Sourcepub fn pop_disposition(self, app: &mut App) -> RoutePopDisposition
pub fn pop_disposition(self, app: &mut App) -> RoutePopDisposition
Sourcepub fn on_pop_invoked_with_result(
self,
app: &mut App,
did_pop: bool,
result: Option<Rc<dyn Any>>,
)
pub fn on_pop_invoked_with_result( self, app: &mut App, did_pop: bool, result: Option<Rc<dyn Any>>, )
Sourcepub fn will_handle_pop_internally(self, app: &App) -> bool
pub fn will_handle_pop_internally(self, app: &App) -> bool
Sourcepub fn did_complete(self, app: &mut App, result: Option<Rc<dyn Any>>)
pub fn did_complete(self, app: &mut App, result: Option<Rc<dyn Any>>)
See Route::did_complete.
Sourcepub fn did_pop_next(self, app: &mut App, next_route: AnyRoute)
pub fn did_pop_next(self, app: &mut App, next_route: AnyRoute)
See Route::did_pop_next.
Sourcepub fn did_change_next(self, app: &mut App, next_route: Option<AnyRoute>)
pub fn did_change_next(self, app: &mut App, next_route: Option<AnyRoute>)
Sourcepub fn did_change_previous(
self,
app: &mut App,
previous_route: Option<AnyRoute>,
)
pub fn did_change_previous( self, app: &mut App, previous_route: Option<AnyRoute>, )
Sourcepub fn changed_internal_state(self, app: &mut App)
pub fn changed_internal_state(self, app: &mut App)
Sourcepub fn changed_external_state(self, app: &mut App)
pub fn changed_external_state(self, app: &mut App)
Sourcepub fn dispose(self, app: &mut App)
pub fn dispose(self, app: &mut App)
See Route::dispose.
Sourcepub fn is_current(self, app: &App) -> bool
pub fn is_current(self, app: &App) -> bool
Whether this route is the top-most route on the navigator.
If this is true, then is_active is also true.
Sourcepub fn is_first(self, app: &App) -> bool
pub fn is_first(self, app: &App) -> bool
Whether this route is the bottom-most active route on the navigator.
If is_first and is_current are both true then
this is the only route on the navigator.
Sourcepub fn has_active_route_below(self, app: &App) -> bool
pub fn has_active_route_below(self, app: &App) -> bool
Whether there is at least one active route underneath this route.
Trait Implementations§
impl Copy for AnyRoute
impl Eq for AnyRoute
Source§impl From<AnyModalRoute> for AnyRoute
A kept route as a RouteRef, through Retained::erase: Dart’s upcast.
impl From<AnyModalRoute> for AnyRoute
A kept route as a RouteRef, through Retained::erase: Dart’s upcast.
Source§fn from(route: AnyModalRoute) -> AnyRoute
fn from(route: AnyModalRoute) -> AnyRoute
Source§impl From<AnyPageRoute> for AnyRoute
A kept page route as a [RouteRef] or a [ModalRouteRef], through
Retained::erase: Dart’s upcast.
impl From<AnyPageRoute> for AnyRoute
A kept page route as a [RouteRef] or a [ModalRouteRef], through
Retained::erase: Dart’s upcast.
Source§fn from(route: AnyPageRoute) -> AnyRoute
fn from(route: AnyPageRoute) -> AnyRoute
Source§impl From<AnyTransitionRoute> for AnyRoute
A kept route as a RouteRef, through Retained::erase: Dart’s upcast.
impl From<AnyTransitionRoute> for AnyRoute
A kept route as a RouteRef, through Retained::erase: Dart’s upcast.
Source§fn from(route: AnyTransitionRoute) -> AnyRoute
fn from(route: AnyTransitionRoute) -> AnyRoute
Auto Trait Implementations§
impl Forget for AnyRoute
impl Freeze for AnyRoute
impl Move for AnyRoute
impl RefUnwindSafe for AnyRoute
impl Send for AnyRoute
impl Sync for AnyRoute
impl Unpin for AnyRoute
impl UnsafeUnpin for AnyRoutewhere
NonZeroU32Inner: UnsafeUnpin,
&'static RouteVTable: UnsafeUnpin,
impl UnwindSafe for AnyRoute
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.