Struct gloo::history::MemoryHistory

source ·
pub struct MemoryHistory { /* private fields */ }
Available on crate feature history only.
Expand description

A History that is implemented with in memory history stack and is usable in most targets.

Panics

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

Implementations§

source§

impl MemoryHistory

source

pub fn new() -> MemoryHistory

Creates a new MemoryHistory with a default entry of ‘/’.

source

pub fn with_entries<'a>( entries: impl IntoIterator<Item = impl Into<Cow<'a, str>>> ) -> MemoryHistory

Creates a new MemoryHistory with entries.

Trait Implementations§

source§

impl Clone for MemoryHistory

source§

fn clone(&self) -> MemoryHistory

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 MemoryHistory

source§

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

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

impl Default for MemoryHistory

source§

fn default() -> MemoryHistory

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

impl From<MemoryHistory> for AnyHistory

source§

fn from(m: MemoryHistory) -> AnyHistory

Converts to this type from the input type.
source§

impl History for MemoryHistory

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 ) -> Result<(), <Q as ToQuery>::Error>where Q: ToQuery,

Available on crate feature query only.
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 ) -> Result<(), <Q as ToQuery>::Error>where Q: ToQuery,

Available on crate feature query only.
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 ) -> Result<(), <Q as ToQuery>::Error>where Q: ToQuery, T: 'static,

Available on crate feature query only.
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 ) -> Result<(), <Q as ToQuery>::Error>where Q: ToQuery, T: 'static,

Available on crate feature query only.
Same as .replace_with_state() but affix the queries to the end of the route.
source§

fn listen<CB>(&self, callback: CB) -> HistoryListenerwhere 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<MemoryHistory> for MemoryHistory

source§

fn eq(&self, rhs: &MemoryHistory) -> 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.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.