pub struct History<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T> History<T>
impl<T> History<T>
pub fn new() -> History<T>
Sourcepub fn max_entries(self, max_entries: usize) -> History<T>
pub fn max_entries(self, max_entries: usize) -> History<T>
Sets the maximum number of root-to-current entries to keep, defaults to 1000.
Lowering the limit immediately removes the oldest entries.
Sourcepub fn replace_current(&mut self, entry: T)
pub fn replace_current(&mut self, entry: T)
Replaces the current entry, or pushes when the trail is empty.
Sourcepub fn remove_current(&mut self) -> Option<T>
pub fn remove_current(&mut self) -> Option<T>
Removes and returns the current entry without changing the forward branch.
Sourcepub fn can_forward(&self) -> bool
pub fn can_forward(&self) -> bool
Returns whether a forward entry is available.
Sourcepub fn back(&mut self) -> Option<T>where
T: Clone,
pub fn back(&mut self) -> Option<T>where
T: Clone,
Moves back one entry and returns the new current entry.
Sourcepub fn forward(&mut self) -> Option<T>where
T: Clone,
pub fn forward(&mut self) -> Option<T>where
T: Clone,
Moves forward one entry and returns the restored entry.
Sourcepub fn entries(&self) -> impl DoubleEndedIterator + ExactSizeIterator
pub fn entries(&self) -> impl DoubleEndedIterator + ExactSizeIterator
Iterates from the root entry to the current entry.
Sourcepub fn forward_entries(&self) -> impl DoubleEndedIterator + ExactSizeIterator
pub fn forward_entries(&self) -> impl DoubleEndedIterator + ExactSizeIterator
Iterates from the nearest forward entry to the furthest.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for History<T>
impl<T> RefUnwindSafe for History<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for History<T>
impl<T> Sync for History<T>
impl<T> Unpin for History<T>
impl<T> UnsafeUnpin for History<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for History<T>where
Vec<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().