pub struct State { /* private fields */ }Expand description
In-memory state that maintains the most recent traces.
Old traces that are no longer updated or accessed will be evicted when the capacity is reached.
Implementations§
Source§impl State
impl State
Sourcepub fn estimated_memory_usage(&self) -> usize
pub fn estimated_memory_usage(&self) -> usize
Get the estimated memory usage of the state in bytes.
Sourcepub fn get_by_id(&mut self, id: &[u8]) -> Option<Trace>
pub fn get_by_id(&mut self, id: &[u8]) -> Option<Trace>
Get a trace by its ID.
The trace will be promoted to the most recent.
Sourcepub fn get_all_complete(&self) -> impl Iterator<Item = Trace> + '_
pub fn get_all_complete(&self) -> impl Iterator<Item = Trace> + '_
Get an iterator over all traces that are complete.
Sourcepub fn get_all_services(&self) -> BTreeSet<&str>
pub fn get_all_services(&self) -> BTreeSet<&str>
Get a set of all services.
Sourcepub fn get_operations(&self, service_name: &str) -> BTreeSet<&str>
pub fn get_operations(&self, service_name: &str) -> BTreeSet<&str>
Get a set of all operations for the given service.
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request