pub struct HashHistory { /* private fields */ }
Expand description

A History that is implemented with web_sys::History and stores path in #(fragment).

Panics

HashHistory does not support relative paths and will panic if routes are not starting with /.

Implementations§

source§

impl HashHistory

source

pub fn new() -> Self

Creates a new HashHistory

Trait Implementations§

source§

impl Clone for HashHistory

source§

fn clone(&self) -> HashHistory

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for HashHistory

source§

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

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

impl Default for HashHistory

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<HashHistory> for AnyHistory

source§

fn from(m: HashHistory) -> AnyHistory

Converts to this type from the input type.
source§

impl History for HashHistory

source§

fn len(&self) -> usize

Returns the number of elements in History.
source§

fn go(&self, delta: isize)

Loads a specific page in History with a delta relative to current page. Read more
source§

fn push<'a>(&self, route: impl Into<Cow<'a, str>>)

Pushes a route entry with None being the state.
source§

fn replace<'a>(&self, route: impl Into<Cow<'a, str>>)

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

fn push_with_state<'a, T>(&self, route: impl Into<Cow<'a, str>>, state: T)
where T: 'static,

Pushes a route entry with state.
source§

fn replace_with_state<'a, T>(&self, route: impl Into<Cow<'a, str>>, state: T)
where T: 'static,

Replaces the current history entry with provided route and state.
source§

fn push_with_query<'a, Q>( &self, route: impl Into<Cow<'a, str>>, query: Q ) -> HistoryResult<(), Q::Error>
where Q: ToQuery,

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

fn replace_with_query<'a, Q>( &self, route: impl Into<Cow<'a, str>>, query: Q ) -> HistoryResult<(), Q::Error>
where Q: ToQuery,

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

fn push_with_query_and_state<'a, Q, T>( &self, route: impl Into<Cow<'a, str>>, query: Q, state: T ) -> HistoryResult<(), Q::Error>
where Q: ToQuery, T: 'static,

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

fn replace_with_query_and_state<'a, Q, T>( &self, route: impl Into<Cow<'a, str>>, query: Q, state: T ) -> HistoryResult<(), Q::Error>
where Q: ToQuery, T: 'static,

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

fn listen<CB>(&self, callback: CB) -> HistoryListener
where CB: Fn() + 'static,

Creates a Listener that will be notified when current state changes. Read more
source§

fn location(&self) -> Location

Returns current Location.
source§

fn is_empty(&self) -> bool

Returns true if the current History is empty.
source§

fn back(&self)

Moves back 1 page in History.
source§

fn forward(&self)

Moves forward 1 page in History.
source§

impl PartialEq for HashHistory

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for HashHistory

Auto Trait Implementations§

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> 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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.