pub struct CommandHistory { /* private fields */ }Expand description
Recent command records retained in memory.
Implementations§
Source§impl CommandHistory
impl CommandHistory
Sourcepub const fn new(limit: usize) -> Self
pub const fn new(limit: usize) -> Self
Creates an empty command history with a maximum record count.
Sourcepub fn start(&mut self, input: CommandRecordStart) -> PendingCommandRecord
pub fn start(&mut self, input: CommandRecordStart) -> PendingCommandRecord
Starts a command record before execution.
Sourcepub fn finish(
&mut self,
pending: &PendingCommandRecord,
finish: CommandRecordFinish,
) -> bool
pub fn finish( &mut self, pending: &PendingCommandRecord, finish: CommandRecordFinish, ) -> bool
Finishes a pending command record.
If the pending record has already been evicted by the history limit, this method does nothing.
Sourcepub fn append(
&mut self,
input: CommandRecordStart,
finish: CommandRecordFinish,
) -> CommandRecordId
pub fn append( &mut self, input: CommandRecordStart, finish: CommandRecordFinish, ) -> CommandRecordId
Appends an already-completed command record.
This is useful for synchronous command paths where the caller already has all timing and result data at the recording boundary.
Sourcepub fn records(&self) -> impl DoubleEndedIterator<Item = &CommandRecord>
pub fn records(&self) -> impl DoubleEndedIterator<Item = &CommandRecord>
Returns retained records from oldest to newest.
Trait Implementations§
Source§impl Clone for CommandHistory
impl Clone for CommandHistory
Source§fn clone(&self) -> CommandHistory
fn clone(&self) -> CommandHistory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandHistory
impl Debug for CommandHistory
Auto Trait Implementations§
impl Freeze for CommandHistory
impl RefUnwindSafe for CommandHistory
impl Send for CommandHistory
impl Sync for CommandHistory
impl Unpin for CommandHistory
impl UnsafeUnpin for CommandHistory
impl UnwindSafe for CommandHistory
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