NavigationStack
struct · ferroui-controls · v0.5.0
struct NavigationStack
The back or the forward stack of a frame (WinUI's IVector<PageStackEntry> of
Frame.BackStack and Frame.ForwardStack): a live, observable list of entries. Clones are the
same list.
An edit is rejected during a navigation, with an index outside the list, or with an entry of the
journal of another frame (NavigationHistory.cpp, PageStackEntryTrackerCollection.cpp); the
edits return a Result where WinUI returns a failing HRESULT.
Members
countis_emptygetsnapshotadd_collection_changedremove_collection_changedaddinsertsetremove_atclear
count
fn count(self: &Self) -> usize
Gets the number of entries.
is_empty
fn is_empty(self: &Self) -> bool
Gets whether the stack has no entry.
get
fn get(self: &Self, index: usize) -> Option<Ref<PageStackEntry>>
Gets the entry at index.
snapshot
fn snapshot(self: &Self) -> Rc<Vec<Ref<PageStackEntry>>>
Gets the entries, oldest first.
add_collection_changed
fn add_collection_changed(self: &Self, handler: Rc<CollectionChangedHandler<Ref<PageStackEntry>>>) -> u64
Adds a handler of the changes of the list; returns its token.
remove_collection_changed
fn remove_collection_changed(self: &Self, token: u64) -> bool
Removes the handler of token.
add
fn add(self: &Self, entry: Ref<PageStackEntry>) -> Result<(), NavigationError>
Adds an entry at the end (the newest).
insert
fn insert(self: &Self, index: usize, entry: Ref<PageStackEntry>) -> Result<(), NavigationError>
Inserts an entry at index.
set
fn set(self: &Self, index: usize, entry: Ref<PageStackEntry>) -> Result<(), NavigationError>
Replaces the entry at index.
remove_at
fn remove_at(self: &Self, index: usize) -> Result<(), NavigationError>
Removes the entry at index.
clear
fn clear(self: &Self) -> Result<(), NavigationError>
Removes every entry.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherClonePartialEqINotifyCollectionChangedINotifyPropertyChangedIItemsListFrom<NavigationStack>MarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.