pub struct InMemorySink { /* private fields */ }Expand description
In-memory sink that collects every recorded StepFact.
Useful for tests and for tooling that wants to inspect the fact stream without going through disk. It builds the same chain as the file sink, so its fingerprint is the one the file would have.
Implementations§
Source§impl InMemorySink
impl InMemorySink
Sourcepub fn header(&self) -> Option<&TranscriptHeader>
pub fn header(&self) -> Option<&TranscriptHeader>
The header, once written.
Trait Implementations§
Source§impl Debug for InMemorySink
impl Debug for InMemorySink
Source§impl Default for InMemorySink
impl Default for InMemorySink
Source§impl TranscriptSink for InMemorySink
impl TranscriptSink for InMemorySink
Source§fn begin(&mut self, header: &TranscriptHeader) -> Result<()>
fn begin(&mut self, header: &TranscriptHeader) -> Result<()>
Write the header line. Must be called once, before any fact. Read more
Source§fn record(
&mut self,
at: DateTime<Utc>,
level: Level,
fact: &StepFact,
) -> Result<()>
fn record( &mut self, at: DateTime<Utc>, level: Level, fact: &StepFact, ) -> Result<()>
Record a single fact at
level, stamped with the caller-supplied
event time at. Must persist before returning, the file-backed
implementation calls sync_data so a power loss after record returns
cannot drop the fact. Read moreAuto Trait Implementations§
impl Freeze for InMemorySink
impl RefUnwindSafe for InMemorySink
impl Send for InMemorySink
impl Sync for InMemorySink
impl Unpin for InMemorySink
impl UnsafeUnpin for InMemorySink
impl UnwindSafe for InMemorySink
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