pub struct TraceAssembler { /* private fields */ }Expand description
In-memory assembler for one trace.
Construct via TraceAssembler::open. Attach events via
TraceAssembler::attach. Seal via TraceAssembler::close.
Implementations§
Source§impl TraceAssembler
impl TraceAssembler
Sourcepub fn open(
id: TraceId,
trace_type: impl Into<String>,
opened_at: DateTime<Utc>,
) -> Self
pub fn open( id: TraceId, trace_type: impl Into<String>, opened_at: DateTime<Utc>, ) -> Self
Open a new trace with the given id, type tag, and open timestamp.
Sourcepub fn status(&self) -> TraceStatus
pub fn status(&self) -> TraceStatus
Current status.
Sourcepub fn attach(&mut self, event_id: EventId) -> Result<u64, TraceError>
pub fn attach(&mut self, event_id: EventId) -> Result<u64, TraceError>
Attach an event to this trace and return its ordinal.
Ordinals start at 0 and are strictly monotonic. Returns
TraceError::Closed if the trace is sealed.
Sourcepub fn close(&mut self, closed_at: DateTime<Utc>) -> Result<Trace, TraceError>
pub fn close(&mut self, closed_at: DateTime<Utc>) -> Result<Trace, TraceError>
Close (seal) the trace.
Returns the persistent Trace row that should be written to the
store. Closing is idempotent on repeated calls only in the sense
that a second call returns AlreadyClosed; callers must take the
Trace from the first successful call.
Trait Implementations§
Source§impl Clone for TraceAssembler
impl Clone for TraceAssembler
Source§fn clone(&self) -> TraceAssembler
fn clone(&self) -> TraceAssembler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TraceAssembler
impl RefUnwindSafe for TraceAssembler
impl Send for TraceAssembler
impl Sync for TraceAssembler
impl Unpin for TraceAssembler
impl UnsafeUnpin for TraceAssembler
impl UnwindSafe for TraceAssembler
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