pub struct ActionLog { /* private fields */ }Expand description
In-memory ring buffer for storing recent actions
Stores actions with timestamps and parameters for display in debug overlays. Older entries are automatically discarded when capacity is reached.
Implementations§
Source§impl ActionLog
impl ActionLog
Sourcepub fn new(config: ActionLogConfig) -> Self
pub fn new(config: ActionLogConfig) -> Self
Create a new action log with configuration
Sourcepub fn log<A: ActionParams>(&mut self, action: &A) -> Option<&ActionLogEntry>
pub fn log<A: ActionParams>(&mut self, action: &A) -> Option<&ActionLogEntry>
Log an action (if it passes the filter)
Returns the entry if it was logged, None if filtered out.
Sourcepub fn entries(&self) -> impl Iterator<Item = &ActionLogEntry>
pub fn entries(&self) -> impl Iterator<Item = &ActionLogEntry>
Get all entries (oldest first)
Sourcepub fn entries_rev(&self) -> impl Iterator<Item = &ActionLogEntry>
pub fn entries_rev(&self) -> impl Iterator<Item = &ActionLogEntry>
Get entries in reverse order (newest first)
Sourcepub fn recent(&self, count: usize) -> impl Iterator<Item = &ActionLogEntry>
pub fn recent(&self, count: usize) -> impl Iterator<Item = &ActionLogEntry>
Get the most recent N entries (newest first)
Sourcepub fn config(&self) -> &ActionLogConfig
pub fn config(&self) -> &ActionLogConfig
Get configuration
Sourcepub fn config_mut(&mut self) -> &mut ActionLogConfig
pub fn config_mut(&mut self) -> &mut ActionLogConfig
Get mutable configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ActionLog
impl RefUnwindSafe for ActionLog
impl Send for ActionLog
impl Sync for ActionLog
impl Unpin for ActionLog
impl UnwindSafe for ActionLog
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more