pub struct Clock {
pub clock_id: Option<u32>,
pub timestamp: Option<u64>,
pub is_incremental: Option<bool>,
pub unit_multiplier_ns: Option<u64>,
}Fields§
§clock_id: Option<u32>Clock IDs have the following semantic: [1, 63]: Builtin types, see BuiltinClock from ../common/builtin_clock.proto. [64, 127]: User-defined clocks. These clocks are sequence-scoped. They are only valid within the same |trusted_packet_sequence_id| (i.e. only for TracePacket(s) emitted by the same TraceWriter that emitted the clock snapshot). [128, MAX]: Reserved for future use. The idea is to allow global clock IDs and setting this ID to hash(full_clock_name) & ~127.
timestamp: Option<u64>Absolute timestamp. Unit is ns unless specified otherwise by the unit_multiplier_ns field below.
is_incremental: Option<bool>When true each TracePacket’s timestamp should be interpreted as a delta from the last TracePacket’s timestamp (referencing this clock) emitted by the same packet_sequence_id. Should only be used for user-defined sequence-local clocks. The first packet timestamp after each ClockSnapshot that contains this clock is relative to the |timestamp| in the ClockSnapshot.
unit_multiplier_ns: Option<u64>Allows to specify a custom unit different than the default (ns) for this clock domain. A multiplier of 1000 means that a timestamp = 3 should be interpreted as 3000 ns = 3 us. All snapshots for the same clock within a trace need to use the same unit.
Implementations§
Source§impl Clock
impl Clock
Sourcepub fn clock_id(&self) -> u32
pub fn clock_id(&self) -> u32
Returns the value of clock_id, or the default value if clock_id is unset.
Sourcepub fn timestamp(&self) -> u64
pub fn timestamp(&self) -> u64
Returns the value of timestamp, or the default value if timestamp is unset.
Sourcepub fn is_incremental(&self) -> bool
pub fn is_incremental(&self) -> bool
Returns the value of is_incremental, or the default value if is_incremental is unset.
Sourcepub fn unit_multiplier_ns(&self) -> u64
pub fn unit_multiplier_ns(&self) -> u64
Returns the value of unit_multiplier_ns, or the default value if unit_multiplier_ns is unset.
Trait Implementations§
Source§impl Message for Clock
impl Message for Clock
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.impl Copy for Clock
impl StructuralPartialEq for Clock
Auto Trait Implementations§
impl Freeze for Clock
impl RefUnwindSafe for Clock
impl Send for Clock
impl Sync for Clock
impl Unpin for Clock
impl UnwindSafe for Clock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].