pub struct TransitionState {
pub active: bool,
pub progress: f64,
pub is_pop: bool,
pub interactive: bool,
pub from_depth: usize,
pub to_depth: usize,
pub generation: u32,
}Expand description
A snapshot of the navigator’s single in-flight page transition, published by
NavigatorWidget and read through
NavigatorController::transition.
Plain Copy data — Send + Sync by construction (every field is a
primitive), so an app may mirror it into an RwSignal, hand it across
provide_context, or read it directly. frust-widgets stays reactive-free:
the navigator publishes this into a plain Rc<Cell<TransitionState>>, exactly
as it publishes depth; any
signal bridging is the facade’s job.
§Timing
The full read-timing contract (which pass sees an exact value and which sees
a one-frame-stale one) is documented on
NavigatorController::transition
— read it before choreographing anything against progress.
Fields§
§active: boolWhether a page transition is in flight right now.
progress: f64The RAW driver value, 0.0 → 1.0. A spatial spring genuinely
overshoots past 1.0 (see the module docs’ overshoot note) — use
clamped for anything driving opacity.
is_pop: booltrue when the transition runs backwards (a pop or an interactive
edge-swipe back); false for a push/replace.
interactive: boolAn interactive edge-swipe is holding the progress (the drag pins it between frames rather than a driver advancing it). Cleared when the swipe is released into its settle spring.
from_depth: usizeThe page-stack depth the transition is leaving.
to_depth: usizeThe page-stack depth the transition is arriving at. Always the navigator’s
current pages.len() — a push/pop/replace mutates the stack up front and
animates afterwards, so the stack is the destination from the first frame.
generation: u32Bumped once per transition started. Distinguishes “the same transition, later” from “a new transition at the same progress” — the discriminator a chrome observer needs to reset its own per-transition state. Wraps.
Implementations§
Source§impl TransitionState
impl TransitionState
Sourcepub const fn settled(depth: usize, generation: u32) -> TransitionState
pub const fn settled(depth: usize, generation: u32) -> TransitionState
The at-rest snapshot for a settled stack of depth pages: nothing in
flight, from_depth == to_depth == depth.
progress is 1.0 — “fully arrived”. With from_depth == to_depth the
value is degenerate (both endpoints are the same stack), so a reader that
ignores active still sees the destination rather than a
jump back to the origin.
Trait Implementations§
Source§impl Clone for TransitionState
impl Clone for TransitionState
Source§fn clone(&self) -> TransitionState
fn clone(&self) -> TransitionState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TransitionState
Source§impl Debug for TransitionState
impl Debug for TransitionState
Source§impl Default for TransitionState
impl Default for TransitionState
Source§fn default() -> TransitionState
fn default() -> TransitionState
The at-rest snapshot of an empty stack — what a
NavigatorController reads before
any navigator attaches to it.
Source§impl PartialEq for TransitionState
impl PartialEq for TransitionState
impl StructuralPartialEq for TransitionState
Auto Trait Implementations§
impl Freeze for TransitionState
impl RefUnwindSafe for TransitionState
impl Send for TransitionState
impl Sync for TransitionState
impl Unpin for TransitionState
impl UnsafeUnpin for TransitionState
impl UnwindSafe for TransitionState
Blanket Implementations§
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<T> Brush for 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.