pub struct TraceIdValidator { /* private fields */ }Expand description
A TraceId validator.
By default, it checks the following properties:
- Cannot be zero.
- Must be 63-bit.
- Cannot have the same node no, because it’s sent outside the elfo system.
Optionally, it can also check the time difference, see
TraceIdValidator::max_time_difference.
Implementations§
Source§impl TraceIdValidator
impl TraceIdValidator
Sourcepub fn max_time_difference(
&mut self,
time_lag: impl Into<Option<Duration>>,
) -> Self
pub fn max_time_difference( &mut self, time_lag: impl Into<Option<Duration>>, ) -> Self
Allowed time difference between now and timestamp in a raw trace id. Checks the absolute difference to handle both situations:
- Too old timestamp, possible incorrectly generated.
- Too new timestamp, something wrong with time synchronization.
Trait Implementations§
Source§impl Clone for TraceIdValidator
impl Clone for TraceIdValidator
Source§fn clone(&self) -> TraceIdValidator
fn clone(&self) -> TraceIdValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for TraceIdValidator
impl Default for TraceIdValidator
Source§fn default() -> TraceIdValidator
fn default() -> TraceIdValidator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TraceIdValidator
impl RefUnwindSafe for TraceIdValidator
impl Send for TraceIdValidator
impl Sync for TraceIdValidator
impl Unpin for TraceIdValidator
impl UnwindSafe for TraceIdValidator
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