pub struct TimestampEncoder { /* private fields */ }Expand description
Converts absolute timestamps into the serialized form of the trace stream. See “Timestamps” in
the docs of TraceRow.
The state can be copied, so that it can be restored when a row is removed again.
Implementations§
Source§impl TimestampEncoder
impl TimestampEncoder
Sourcepub fn encode(&mut self, ts: u64) -> (Option<u64>, DeltaEncodedTimestamp)
pub fn encode(&mut self, ts: u64) -> (Option<u64>, DeltaEncodedTimestamp)
Returns the value to serialize for the absolute timestamp ts, and, if needed, the
timestamp of a TraceRow::TimestampBase row that has to be written before it.
A base is needed for the first timestamp, and when the difference to the previous
timestamp doesn’t fit into an i64.
Sourcepub fn encode_row<'a>(
&mut self,
row: TraceRow<'a, u64>,
) -> (Option<TraceRow<'static>>, TraceRow<'a>)
pub fn encode_row<'a>( &mut self, row: TraceRow<'a, u64>, ) -> (Option<TraceRow<'static>>, TraceRow<'a>)
Converts row into its serialized form. Also returns the TraceRow::TimestampBase row
that has to be written before it, if needed.
Trait Implementations§
Source§impl Clone for TimestampEncoder
impl Clone for TimestampEncoder
impl Copy for TimestampEncoder
Source§impl Debug for TimestampEncoder
impl Debug for TimestampEncoder
Auto Trait Implementations§
impl Freeze for TimestampEncoder
impl RefUnwindSafe for TimestampEncoder
impl Send for TimestampEncoder
impl Sync for TimestampEncoder
impl Unpin for TimestampEncoder
impl UnsafeUnpin for TimestampEncoder
impl UnwindSafe for TimestampEncoder
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