pub struct History<Event>(_);
Expand description
The tracking history of a target.
A history is a sequence of the tracked events.
Examples
use std::fmt::{Display, Formatter, Result};
use trackable::History;
struct Event(&'static str);
impl Display for Event {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "event: {}", self.0)
}
}
let mut history = History::new();
history.add(Event("foo"));
history.add(Event("bar"));
assert_eq!(format!("\n{}", history), r#"
HISTORY:
[0] event: foo
[1] event: bar
"#);
Implementations§
Trait Implementations§
source§impl<'de, Event> Deserialize<'de> for History<Event>where
Event: Deserialize<'de>,
impl<'de, Event> Deserialize<'de> for History<Event>where Event: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<Event> RefUnwindSafe for History<Event>where Event: RefUnwindSafe,
impl<Event> Send for History<Event>where Event: Send,
impl<Event> Sync for History<Event>where Event: Sync,
impl<Event> Unpin for History<Event>where Event: Unpin,
impl<Event> UnwindSafe for History<Event>where Event: 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