pub struct TimeInt(Option<NonMinI64>);
Expand description
A 64-bit number describing either nanoseconds, sequence numbers or fully static data.
Must be matched with a crate::TimeType
to know what.
Used both for time points and durations.
Tuple Fields§
§0: Option<NonMinI64>
Implementations§
Source§impl TimeInt
impl TimeInt
Sourcepub const STATIC: Self = _
pub const STATIC: Self = _
Special value used to represent static data.
It is illegal to create a TimeInt
with that value in a temporal context.
SDK users cannot log data at that timestamp explicitly, the only way to do so is to use the static APIs.
Sourcepub const MIN: Self = _
pub const MIN: Self = _
Value used to represent the minimal temporal value a TimeInt
can hold.
This is not i64::MIN
, as that is a special value reserved as a marker for static
data (see Self::STATIC
).
pub const ZERO: Self = _
pub const ONE: Self = _
pub fn is_static(self) -> bool
Sourcepub fn new_temporal(time: i64) -> Self
pub fn new_temporal(time: i64) -> Self
Creates a new temporal TimeInt
.
If time
is i64::MIN
, this will return TimeInt::MIN
.
This can’t return TimeInt::STATIC
, ever.
Sourcepub fn from_nanos(nanos: NonMinI64) -> Self
pub fn from_nanos(nanos: NonMinI64) -> Self
For time timelines.
Sourcepub fn from_millis(millis: NonMinI64) -> Self
pub fn from_millis(millis: NonMinI64) -> Self
For time timelines.
Sourcepub fn from_sequence(sequence: NonMinI64) -> Self
pub fn from_sequence(sequence: NonMinI64) -> Self
For sequence timelines.
Sourcepub fn saturated_temporal_i64(value: impl Into<i64>) -> Self
pub fn saturated_temporal_i64(value: impl Into<i64>) -> Self
Clamp to valid non-static range.
Sourcepub fn saturated_temporal(value: impl TryInto<Self>) -> Self
pub fn saturated_temporal(value: impl TryInto<Self>) -> Self
Clamp to valid non-static range.
Sourcepub const fn as_i64(self) -> i64
pub const fn as_i64(self) -> i64
Returns i64::MIN
for Self::STATIC
.
Sourcepub const fn as_f64(self) -> f64
pub const fn as_f64(self) -> f64
Returns f64::MIN
for Self::STATIC
.
Sourcepub fn inc(self) -> Self
pub fn inc(self) -> Self
Always returns Self::STATIC
for Self::STATIC
.
Sourcepub fn dec(self) -> Self
pub fn dec(self) -> Self
Always returns Self::STATIC
for Self::STATIC
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TimeInt
impl<'de> Deserialize<'de> for TimeInt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Ord for TimeInt
impl Ord for TimeInt
Source§impl PartialOrd<TimeInt> for TimeReal
impl PartialOrd<TimeInt> for TimeReal
Source§impl PartialOrd<TimeReal> for TimeInt
impl PartialOrd<TimeReal> for TimeInt
Source§impl PartialOrd for TimeInt
impl PartialOrd for TimeInt
Source§impl SizeBytes for TimeInt
impl SizeBytes for TimeInt
Source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self
uses on the heap. Read moreSource§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self
in bytes, accounting for both stack and heap space.Source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self
on the stack, in bytes. Read moreimpl Copy for TimeInt
impl Eq for TimeInt
impl StructuralPartialEq for TimeInt
Auto Trait Implementations§
impl Freeze for TimeInt
impl RefUnwindSafe for TimeInt
impl Send for TimeInt
impl Sync for TimeInt
impl Unpin for TimeInt
impl UnwindSafe for TimeInt
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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