Skip to main content

AnyRoute

Struct AnyRoute 

Source
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

Source

pub fn upgrade(self, app: &App) -> Option<Retained<AnyRoute>>

A reference while something still keeps the object, None once it is freed or its last keeper has let go; see Handle::upgrade.

Source

pub fn keep(self, app: &App) -> Retained<AnyRoute>

A reference to an object something is known to keep; see Handle::keep.

Source§

impl AnyRoute

Source

pub fn id(self) -> HandleId

The arena id behind this handle.

Source

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.

Source

pub fn as_transition_route(self, app: &App) -> Option<AnyTransitionRoute>

Dart’s route is TransitionRoute<dynamic>.

Source

pub fn as_modal_route(self, app: &App) -> Option<AnyModalRoute>

Dart’s route is ModalRoute<dynamic>.

Source

pub fn as_page_route(self, app: &App) -> Option<AnyPageRoute>

Dart’s route is PageRoute<dynamic>.

Source

pub fn interface<I>(self) -> Option<I>
where I: 'static,

See Route::interface: Dart’s route is SomeMixin, as interface::<Rc<dyn SomeMixin>>().

Source

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.

Source

pub fn navigator(self, app: &App) -> Option<Handle<NavigatorState>>

The navigator that the route is in, if any.

Source

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.

Source

pub fn is_page_based(self, app: &App) -> bool

Dart’s Route._isPageBased.

Source

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.

Source

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.

Source

pub fn overlay_entries(self, app: &App) -> Vec<Handle<OverlayEntry>>

Source

pub fn install(self, app: &mut App)

Source

pub fn did_push(self, app: &mut App) -> TickerFuture ⓘ

Source

pub fn did_add(self, app: &mut App)

Source

pub fn did_replace(self, app: &mut App, old_route: Option<AnyRoute>)

Source

pub fn will_pop(self, app: &mut App) -> RoutePopDisposition

Source

pub fn pop_disposition(self, app: &mut App) -> RoutePopDisposition

Source

pub fn on_pop_invoked_with_result( self, app: &mut App, did_pop: bool, result: Option<Rc<dyn Any>>, )

Source

pub fn will_handle_pop_internally(self, app: &App) -> bool

Source

pub fn current_result(self, app: &App) -> Option<Rc<dyn Any>>

Source

pub fn did_pop(self, app: &mut App, result: Option<Rc<dyn Any>>) -> bool

Source

pub fn did_complete(self, app: &mut App, result: Option<Rc<dyn Any>>)

Source

pub fn did_pop_next(self, app: &mut App, next_route: AnyRoute)

Source

pub fn did_change_next(self, app: &mut App, next_route: Option<AnyRoute>)

Source

pub fn did_change_previous( self, app: &mut App, previous_route: Option<AnyRoute>, )

Source

pub fn changed_internal_state(self, app: &mut App)

Source

pub fn changed_external_state(self, app: &mut App)

Source

pub fn dispose(self, app: &mut App)

Source

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.

Source

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.

Source

pub fn has_active_route_below(self, app: &App) -> bool

Whether there is at least one active route underneath this route.

Source

pub fn is_active(self, app: &App) -> bool

Whether this route is on the navigator.

If the route is not only active, but also the current route (the top-most route), then is_current will also be true. If it is the first route (the bottom-most route), then is_first will also be true.

Trait Implementations§

Source§

impl Clone for AnyRoute

Source§

fn clone(&self) -> AnyRoute

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AnyRoute

Source§

impl Debug for AnyRoute

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for AnyRoute

Source§

impl From<AnyModalRoute> for AnyRoute

A kept route as a RouteRef, through Retained::erase: Dart’s upcast.

Source§

fn from(route: AnyModalRoute) -> AnyRoute

Converts to this type from the input type.
Source§

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

Converts to this type from the input type.
Source§

impl From<AnyRoute> for HandleId

Source§

fn from(handle: AnyRoute) -> HandleId

Converts to this type from the input type.
Source§

impl From<AnyTransitionRoute> for AnyRoute

A kept route as a RouteRef, through Retained::erase: Dart’s upcast.

Source§

fn from(route: AnyTransitionRoute) -> AnyRoute

Converts to this type from the input type.
Source§

impl<Leaf> From<Handle<Leaf>> for AnyRoute
where Leaf: Route,

Source§

fn from(handle: Handle<Leaf>) -> AnyRoute

Converts to this type from the input type.
Source§

impl Hash for AnyRoute

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AnyRoute

Source§

fn eq(&self, other: &AnyRoute) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<AnyRoute> for &Retained<AnyRoute>

Source§

fn eq(&self, other: &AnyRoute) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<Retained<AnyRoute>> for AnyRoute

Source§

fn eq(&self, other: &Retained<AnyRoute>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl Forget for AnyRoute

§

impl Freeze for AnyRoute
where NonZero<u32>: Freeze, &'static RouteVTable: Freeze,

§

impl Move for AnyRoute

§

impl RefUnwindSafe for AnyRoute

§

impl Send for AnyRoute
where NonZero<u32>: Send, &'static RouteVTable: Send,

§

impl Sync for AnyRoute
where NonZero<u32>: Sync,

§

impl Unpin for AnyRoute
where NonZero<u32>: Unpin, &'static RouteVTable: Unpin,

§

impl UnsafeUnpin for AnyRoute
where NonZeroU32Inner: UnsafeUnpin, &'static RouteVTable: UnsafeUnpin,

§

impl UnwindSafe for AnyRoute
where NonZero<u32>: UnwindSafe, &'static RouteVTable: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: PartialEq + Hash + Debug + 'static,

Source§

fn eq_any(&self, other: &(dyn AnyEq + 'static)) -> bool

Dart’s operator ==. Must return false when other is a different concrete type, even if the two carry the same value.
Source§

fn hash_any(&self, state: &mut dyn Hasher)

Dart’s hashCode. Must mix in the concrete type so that two types carrying the same value do not collide.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> SlotValue for T
where T: Clone + Eq + Hash + Debug + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more