pub trait History: Clone + PartialEq<Self> {
Show 15 methods fn len(&self) -> usize; fn go(&self, delta: isize); fn push<'a>(&self, route: impl Into<Cow<'a, str>>); fn replace<'a>(&self, route: impl Into<Cow<'a, str>>); fn push_with_state<'a, T>(&self, route: impl Into<Cow<'a, str>>, state: T)
    where
        T: 'static
; fn replace_with_state<'a, T>(&self, route: impl Into<Cow<'a, str>>, state: T)
    where
        T: 'static
; fn push_with_query<'a, Q>(
        &self,
        route: impl Into<Cow<'a, str>>,
        query: Q
    ) -> Result<(), HistoryError>
    where
        Q: Serialize
; fn replace_with_query<'a, Q>(
        &self,
        route: impl Into<Cow<'a, str>>,
        query: Q
    ) -> Result<(), HistoryError>
    where
        Q: Serialize
; fn push_with_query_and_state<'a, Q, T>(
        &self,
        route: impl Into<Cow<'a, str>>,
        query: Q,
        state: T
    ) -> Result<(), HistoryError>
    where
        Q: Serialize,
        T: 'static
; fn replace_with_query_and_state<'a, Q, T>(
        &self,
        route: impl Into<Cow<'a, str>>,
        query: Q,
        state: T
    ) -> Result<(), HistoryError>
    where
        Q: Serialize,
        T: 'static
; fn listen<CB>(&self, callback: CB) -> HistoryListener
    where
        CB: 'static + Fn()
; fn location(&self) -> Location; fn is_empty(&self) -> bool { ... } fn back(&self) { ... } fn forward(&self) { ... }
}
Expand description

A trait to provide History access.

Warning

The behaviour of this trait is not well-defined when you mix multiple history kinds in the same application or use window().history() to update session history.

Required Methods§

Returns the number of elements in History.

Loads a specific page in History with a delta relative to current page.

See: https://developer.mozilla.org/en-US/docs/Web/API/History/go

Pushes a route entry with None being the state.

Replaces the current history entry with provided route and None state.

Pushes a route entry with state.

Replaces the current history entry with provided route and state.

Same as .push() but affix the queries to the end of the route.

Same as .replace() but affix the queries to the end of the route.

Same as .push_with_state() but affix the queries to the end of the route.

Same as .replace_with_state() but affix the queries to the end of the route.

Creates a Listener that will be notified when current state changes.

This method returns a [HistoryListener] that will automatically unregister the callback when dropped.

Returns current Location.

Provided Methods§

Returns true if the current History is empty.

Moves back 1 page in History.

Moves forward 1 page in History.

Implementors§