pub struct Trail { /* private fields */ }Expand description
Focus history with browser-like back/forward behavior.
record(node)appends and moves the cursor.- If cursor isn’t at tail, forward history is dropped.
forget_node(node)removes all occurrences and preserves chain.
Implementations§
Source§impl Trail
impl Trail
pub fn new() -> Self
pub fn cursor(&self) -> Option<NodeId>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn entries(&self) -> Vec<NodeId>
pub fn cursor_index(&self) -> Option<usize>
pub fn node_at_index(&self, index: usize) -> Option<NodeId>
pub fn seek_to_index(&mut self, index: usize) -> Option<NodeId>
pub fn seek_to_node(&mut self, node: NodeId) -> bool
pub fn back_wrapping(&mut self) -> Option<NodeId>
pub fn forward_wrapping(&mut self) -> Option<NodeId>
pub fn truncate_to(&mut self, max_len: usize)
Sourcepub fn forget_node(&mut self, node: NodeId)
pub fn forget_node(&mut self, node: NodeId)
Remove all history entries for a given node id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trail
impl RefUnwindSafe for Trail
impl Send for Trail
impl Sync for Trail
impl Unpin for Trail
impl UnsafeUnpin for Trail
impl UnwindSafe for Trail
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