pub struct TaskLogStore { /* private fields */ }Expand description
In-memory ring buffer of recent task executions.
Arc<TaskLogStore> is Clone because Arc<T> implements Clone for any
T: ?Sized. TaskLogStore itself does not need to implement Clone.
Implementations§
Source§impl TaskLogStore
impl TaskLogStore
pub fn new(max_entries: usize) -> Self
Sourcepub fn push(&self, execution: TaskExecution)
pub fn push(&self, execution: TaskExecution)
Append an execution record, evicting the oldest entry when full.
Sourcepub fn get(&self, id: &str) -> Option<TaskExecution>
pub fn get(&self, id: &str) -> Option<TaskExecution>
Look up a specific execution by ID. Returns a clone.
Sourcepub fn recent(&self, n: usize) -> Vec<TaskExecutionSummary>
pub fn recent(&self, n: usize) -> Vec<TaskExecutionSummary>
Return summaries of the most recent n executions (newest first).
Auto Trait Implementations§
impl !Freeze for TaskLogStore
impl RefUnwindSafe for TaskLogStore
impl Send for TaskLogStore
impl Sync for TaskLogStore
impl Unpin for TaskLogStore
impl UnsafeUnpin for TaskLogStore
impl UnwindSafe for TaskLogStore
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