pub struct CorrelationTracker { /* private fields */ }Expand description
Tracker for managing correlation contexts across operations
Implementations§
Source§impl CorrelationTracker
impl CorrelationTracker
Sourcepub fn register(&self, correlation_id: CorrelationId)
pub fn register(&self, correlation_id: CorrelationId)
Register a new correlation ID
Sourcepub async fn store_context(&self, context: CorrelationContext)
pub async fn store_context(&self, context: CorrelationContext)
Store a correlation context
Sourcepub async fn get_context(
&self,
correlation_id: &CorrelationId,
) -> Option<CorrelationContext>
pub async fn get_context( &self, correlation_id: &CorrelationId, ) -> Option<CorrelationContext>
Retrieve a correlation context
Sourcepub async fn remove_context(
&self,
correlation_id: &CorrelationId,
) -> Option<CorrelationContext>
pub async fn remove_context( &self, correlation_id: &CorrelationId, ) -> Option<CorrelationContext>
Remove a correlation context
Sourcepub async fn get_active_contexts(&self) -> Vec<CorrelationContext>
pub async fn get_active_contexts(&self) -> Vec<CorrelationContext>
Get all active correlation contexts
Sourcepub async fn cleanup_old_contexts(&self, max_age: Duration)
pub async fn cleanup_old_contexts(&self, max_age: Duration)
Clean up old contexts (should be called periodically)
Trait Implementations§
Source§impl Debug for CorrelationTracker
impl Debug for CorrelationTracker
Auto Trait Implementations§
impl Freeze for CorrelationTracker
impl !RefUnwindSafe for CorrelationTracker
impl Send for CorrelationTracker
impl Sync for CorrelationTracker
impl Unpin for CorrelationTracker
impl !UnwindSafe for CorrelationTracker
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> 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