pub struct NavigationProgress { /* private fields */ }Expand description
Attempt bookkeeping every consumer otherwise re-implements: because attempts may overlap (WebView2), a terminal event for an older attempt must not clear loading UI for the newest one.
Implementations§
Sourcepub fn apply(&mut self, event: &NavigationEvent)
pub fn apply(&mut self, event: &NavigationEvent)
Fold one event into the progress state.
Sourcepub fn is_loading(&self) -> bool
pub fn is_loading(&self) -> bool
True while the newest attempt has no terminal event.
Sourcepub fn current(&self) -> Option<NavigationId>
pub fn current(&self) -> Option<NavigationId>
The newest attempt, until its terminal arrives.
Sourcepub fn is_current(&self, id: NavigationId) -> bool
pub fn is_current(&self, id: NavigationId) -> bool
Whether id is the newest attempt (terminal or not).
Sourcepub fn classify<'a>(
&mut self,
event: &'a NavigationEvent,
) -> NavigationOutcome<'a>
pub fn classify<'a>( &mut self, event: &'a NavigationEvent, ) -> NavigationOutcome<'a>
Folds event in and classifies it for a delegate that only acts on the
newest attempt. Every consumer needs the same rule — a stale terminal
must never mark a newer load as loaded or failed — so it lives here
rather than being re-derived per delegate.
Trait Implementations§
Source§fn default() -> NavigationProgress
fn default() -> NavigationProgress
Returns the “default value” for a type. Read more
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more