pub struct HistoryState<T>(pub Option<T>);Expand description
The state attached to the current history entry, if it is a T.
It is set with Nav::push_state or
Nav::replace_state. Borrowed: extract it as HistoryState<&T>.
It belongs to the history entry, not to the page: back and forward between the entries of a page swap it, and coming back to an entry of a page that was left restores it. A new navigation starts without it, and a browser reload loses it.
For state the view owns and mutates, see PageState and
Snapshot.
Tuple Fields§
§0: Option<T>Trait Implementations§
Source§impl<T: Clone> Clone for HistoryState<T>
impl<T: Clone> Clone for HistoryState<T>
impl<T: Copy> Copy for HistoryState<T>
Source§impl<T: Debug> Debug for HistoryState<T>
impl<T: Debug> Debug for HistoryState<T>
impl<T: Eq> Eq for HistoryState<T>
Source§impl<S: 'static, D, T: Any> FromView<S, D> for HistoryState<&T>
impl<S: 'static, D, T: Any> FromView<S, D> for HistoryState<&T>
type Item<'f> = HistoryState<&'f T>
fn from_view<'f>(cx: &'f ViewContext<'_, S>) -> HistoryState<&'f T>
Source§impl<T: PartialEq> PartialEq for HistoryState<T>
impl<T: PartialEq> PartialEq for HistoryState<T>
impl<T: PartialEq> StructuralPartialEq for HistoryState<T>
Auto Trait Implementations§
impl<T> Forget for HistoryState<T>
impl<T> Freeze for HistoryState<T>where
T: Freeze,
impl<T> Move for HistoryState<T>
impl<T> RefUnwindSafe for HistoryState<T>where
T: RefUnwindSafe,
impl<T> Send for HistoryState<T>where
T: Send,
impl<T> Sync for HistoryState<T>where
T: Sync,
impl<T> Unpin for HistoryState<T>where
T: Unpin,
impl<T> UnsafeUnpin for HistoryState<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for HistoryState<T>where
T: UnwindSafe,
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more