pub struct State { /* private fields */ }Expand description
The state of a trace.
Implementations§
Source§impl State
impl State
Sourcepub const fn default_flow_id() -> FlowId
pub const fn default_flow_id() -> FlowId
Return the id of the default flow.
Sourcepub fn hops_for_flow(&self, flow_id: FlowId) -> &[Hop]
pub fn hops_for_flow(&self, flow_id: FlowId) -> &[Hop]
Information about each hop for a given flow.
Sourcepub fn is_target(&self, hop: &Hop, flow_id: FlowId) -> bool
pub fn is_target(&self, hop: &Hop, flow_id: FlowId) -> bool
Is a given Hop the target hop for a given flow?
A Hop is considered to be the target if it has the highest ttl value observed.
Note that if the target host does not respond to probes then the highest ttl observed
will be one greater than the ttl of the last host which did respond.
Sourcepub fn is_in_round(&self, hop: &Hop, flow_id: FlowId) -> bool
pub fn is_in_round(&self, hop: &Hop, flow_id: FlowId) -> bool
Is a given Hop in the current round for a given flow?
Sourcepub fn target_hop(&self, flow_id: FlowId) -> &Hop
pub fn target_hop(&self, flow_id: FlowId) -> &Hop
Return the target Hop for a given flow.
Sourcepub fn round(&self, flow_id: FlowId) -> Option<usize>
pub fn round(&self, flow_id: FlowId) -> Option<usize>
The current round of tracing for a given flow.
Sourcepub fn round_count(&self, flow_id: FlowId) -> usize
pub fn round_count(&self, flow_id: FlowId) -> usize
The total rounds of tracing for a given flow.
Sourcepub const fn round_flow_id(&self) -> FlowId
pub const fn round_flow_id(&self) -> FlowId
The FlowId for the current round.
pub fn set_error(&mut self, error: Option<String>)
Sourcepub const fn max_samples(&self) -> usize
pub const fn max_samples(&self) -> usize
The maximum number of samples to record per hop.
Sourcepub fn update_from_round(&mut self, round: &Round<'_>)
pub fn update_from_round(&mut self, round: &Round<'_>)
Update the tracing state from a TracerRound.
Trait Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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