pub enum InstrumentationTimestamp {
UHLC(Timestamp),
Custom(Vec<u8>),
}Available on crate feature
unstable only.Expand description
A timestamp measurement, either UHLC or the result of a custom user-defined callback.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
The semantics depend on whether a custom timestamp callback was registered on the session that performed the measurement:
- UHLC: the default — a Zenoh UHLC hybrid logical clock timestamp.
- Custom: arbitrary bytes produced by the user-defined callback.
§Example
use zenoh::timestamp_stack::InstrumentationTimestamp;
// InstrumentationTimestamp is usually constructed automatically.
let ts = InstrumentationTimestamp::Custom(b"my_format".to_vec());
// Pattern match to handle both variants:
match &ts {
InstrumentationTimestamp::UHLC(uhlc_ts) => println!("UHLC: {:?}", uhlc_ts),
InstrumentationTimestamp::Custom(bytes) => println!("Custom({} bytes)", bytes.len()),
}Variants§
UHLC(Timestamp)
A Zenoh UHLC hybrid logical clock timestamp.
Custom(Vec<u8>)
A timestamp in a format defined by the user’s custom timestamp callback.
Trait Implementations§
Source§impl Clone for InstrumentationTimestamp
impl Clone for InstrumentationTimestamp
Source§fn clone(&self) -> InstrumentationTimestamp
fn clone(&self) -> InstrumentationTimestamp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InstrumentationTimestamp
impl Debug for InstrumentationTimestamp
impl Eq for InstrumentationTimestamp
Source§impl PartialEq for InstrumentationTimestamp
impl PartialEq for InstrumentationTimestamp
impl StructuralPartialEq for InstrumentationTimestamp
Auto Trait Implementations§
impl Freeze for InstrumentationTimestamp
impl RefUnwindSafe for InstrumentationTimestamp
impl Send for InstrumentationTimestamp
impl Sync for InstrumentationTimestamp
impl Unpin for InstrumentationTimestamp
impl UnsafeUnpin for InstrumentationTimestamp
impl UnwindSafe for InstrumentationTimestamp
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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