pub struct InMemoryTraceRepository { /* private fields */ }Expand description
In-memory trace repository for testing.
Data is lost when the struct is dropped. All methods are O(n) linear scans.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryTraceRepository
impl Default for InMemoryTraceRepository
Source§impl TraceRepository for InMemoryTraceRepository
impl TraceRepository for InMemoryTraceRepository
Source§fn store_trace<'life0, 'life1, 'async_trait>(
&'life0 self,
trace: &'life1 TraceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_trace<'life0, 'life1, 'async_trait>(
&'life0 self,
trace: &'life1 TraceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a trace event with all its spans.
Source§fn store_span<'life0, 'life1, 'async_trait>(
&'life0 self,
span: &'life1 TraceSpan,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_span<'life0, 'life1, 'async_trait>(
&'life0 self,
span: &'life1 TraceSpan,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a single trace span.
Source§fn query_traces<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 TraceQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<TraceEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_traces<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 TraceQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<TraceEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query traces with filters.
Source§fn query_spans<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 TraceQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<TraceSpan>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_spans<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 TraceQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<TraceSpan>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query spans with filters.
Source§fn get_trace<'life0, 'async_trait>(
&'life0 self,
tenant_id: TenantId,
trace_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<TraceEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_trace<'life0, 'async_trait>(
&'life0 self,
tenant_id: TenantId,
trace_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<TraceEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a specific trace by ID.
Source§fn get_span<'life0, 'async_trait>(
&'life0 self,
tenant_id: TenantId,
span_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<TraceSpan>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_span<'life0, 'async_trait>(
&'life0 self,
tenant_id: TenantId,
span_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<TraceSpan>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a specific span by ID.
Source§fn delete_traces_before<'life0, 'async_trait>(
&'life0 self,
tenant_id: TenantId,
before: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_traces_before<'life0, 'async_trait>(
&'life0 self,
tenant_id: TenantId,
before: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete traces older than the specified time.
Auto Trait Implementations§
impl !Freeze for InMemoryTraceRepository
impl !RefUnwindSafe for InMemoryTraceRepository
impl Send for InMemoryTraceRepository
impl Sync for InMemoryTraceRepository
impl Unpin for InMemoryTraceRepository
impl UnsafeUnpin for InMemoryTraceRepository
impl !UnwindSafe for InMemoryTraceRepository
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