pub struct TimestampMillis(/* private fields */);Expand description
Represents a point in time as milliseconds since the Unix epoch.
Implementations§
Source§impl TimestampMillis
impl TimestampMillis
pub const fn new(millis: u64) -> TimestampMillis
pub fn as_u64_millis(&self) -> u64
Sourcepub fn to_seconds(&self) -> TimestampSeconds
pub fn to_seconds(&self) -> TimestampSeconds
Explicit conversion to seconds, truncating any millisecond precision
pub const fn zero() -> TimestampMillis
pub const fn max() -> TimestampMillis
Trait Implementations§
Source§impl Add<DurationMillis> for TimestampMillis
impl Add<DurationMillis> for TimestampMillis
Source§type Output = TimestampMillis
type Output = TimestampMillis
The resulting type after applying the
+ operator.Source§fn add(
self,
rhs: DurationMillis,
) -> <TimestampMillis as Add<DurationMillis>>::Output
fn add( self, rhs: DurationMillis, ) -> <TimestampMillis as Add<DurationMillis>>::Output
Performs the
+ operation. Read moreSource§impl<Env> AnnotatedValue<Env, TimestampMillis> for u64where
Env: TxEnv,
impl<Env> AnnotatedValue<Env, TimestampMillis> for u64where
Env: TxEnv,
fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api>
Source§fn to_value(&self, _env: &Env) -> TimestampMillis
fn to_value(&self, _env: &Env) -> TimestampMillis
Produces the value from a reference of the annotated type. Might involve a
.clone() in some cases.Source§fn into_value(self, env: &Env) -> T
fn into_value(self, env: &Env) -> T
Consumes annotated value to produce actual value. Read more
Source§impl<Env> AnnotatedValue<Env, TimestampMillis> for TimestampMilliswhere
Env: TxEnv,
impl<Env> AnnotatedValue<Env, TimestampMillis> for TimestampMilliswhere
Env: TxEnv,
fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api>
Source§fn to_value(&self, _env: &Env) -> TimestampMillis
fn to_value(&self, _env: &Env) -> TimestampMillis
Produces the value from a reference of the annotated type. Might involve a
.clone() in some cases.Source§fn into_value(self, env: &Env) -> T
fn into_value(self, env: &Env) -> T
Consumes annotated value to produce actual value. Read more
Source§impl Clone for TimestampMillis
impl Clone for TimestampMillis
Source§fn clone(&self) -> TimestampMillis
fn clone(&self) -> TimestampMillis
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 moreimpl Copy for TimestampMillis
Source§impl Debug for TimestampMillis
impl Debug for TimestampMillis
Source§impl Default for TimestampMillis
impl Default for TimestampMillis
Source§fn default() -> TimestampMillis
fn default() -> TimestampMillis
Returns the “default value” for a type. Read more
Source§impl Display for TimestampMillis
impl Display for TimestampMillis
impl Eq for TimestampMillis
Source§impl Hash for TimestampMillis
impl Hash for TimestampMillis
Source§impl ManagedVecItem for TimestampMillis
impl ManagedVecItem for TimestampMillis
Source§const SKIPS_RESERIALIZATION: bool = true
const SKIPS_RESERIALIZATION: bool = true
If true, then the encoding of the item is identical to the payload,
and no further conversion is necessary
(the underlying buffer can be used as-is during serialization).
False for all managed types, but true for basic types (like
u32).Source§type PAYLOAD = ManagedVecItemPayloadBuffer<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>
type PAYLOAD = ManagedVecItemPayloadBuffer<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>
Type managing the underlying binary representation in a ManagedVec..
Source§type Ref<'a> = TimestampMillis
type Ref<'a> = TimestampMillis
Reference representation of the ManagedVec item. Read more
Source§unsafe fn read_from_payload(payload: &Self::PAYLOAD) -> Self
unsafe fn read_from_payload(payload: &Self::PAYLOAD) -> Self
Parses given bytes as a an owned object. Read more
Source§unsafe fn borrow_from_payload<'a>(payload: &Self::PAYLOAD) -> Self::Ref<'a>
unsafe fn borrow_from_payload<'a>(payload: &Self::PAYLOAD) -> Self::Ref<'a>
Parses given bytes as a representation of the object, either owned, or a reference. Read more
Source§fn save_to_payload(self, payload: &mut Self::PAYLOAD)
fn save_to_payload(self, payload: &mut Self::PAYLOAD)
Converts the object into bytes. Read more
Source§fn requires_drop() -> bool
fn requires_drop() -> bool
Signals that vec should drop all items one by one when being itself dropped. Read more
fn payload_size() -> usize
fn temp_decode<F, R>(payload: &Self::PAYLOAD, f: F) -> Rwhere
F: FnOnce(&Self) -> R,
Source§impl NestedDecode for TimestampMillis
impl NestedDecode for TimestampMillis
Source§fn dep_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<TimestampMillis, <H as DecodeErrorHandler>::HandledErr>where
I: NestedDecodeInput,
H: DecodeErrorHandler,
fn dep_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<TimestampMillis, <H as DecodeErrorHandler>::HandledErr>where
I: NestedDecodeInput,
H: DecodeErrorHandler,
Version of
dep_decode that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn dep_decode<I>(input: &mut I) -> Result<Self, DecodeError>where
I: NestedDecodeInput,
fn dep_decode<I>(input: &mut I) -> Result<Self, DecodeError>where
I: NestedDecodeInput,
Attempt to deserialise the value from input,
using the format of an object nested inside another structure.
In case of success returns the deserialized value and the number of bytes consumed during the operation.
Source§impl NestedEncode for TimestampMillis
impl NestedEncode for TimestampMillis
Source§fn dep_encode_or_handle_err<O, H>(
&self,
dest: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: NestedEncodeOutput,
H: EncodeErrorHandler,
fn dep_encode_or_handle_err<O, H>(
&self,
dest: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: NestedEncodeOutput,
H: EncodeErrorHandler,
Version of
dep_encode that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>where
O: NestedEncodeOutput,
fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>where
O: NestedEncodeOutput,
NestedEncode to output, using the format of an object nested inside another structure.
Does not provide compact version.
Source§impl Ord for TimestampMillis
impl Ord for TimestampMillis
Source§fn cmp(&self, other: &TimestampMillis) -> Ordering
fn cmp(&self, other: &TimestampMillis) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TimestampMillis
impl PartialEq for TimestampMillis
Source§fn eq(&self, other: &TimestampMillis) -> bool
fn eq(&self, other: &TimestampMillis) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TimestampMillis
impl PartialOrd for TimestampMillis
impl StructuralPartialEq for TimestampMillis
Source§impl Sub for TimestampMillis
impl Sub for TimestampMillis
Source§type Output = DurationMillis
type Output = DurationMillis
The resulting type after applying the
- operator.Source§fn sub(self, rhs: TimestampMillis) -> <TimestampMillis as Sub>::Output
fn sub(self, rhs: TimestampMillis) -> <TimestampMillis as Sub>::Output
Performs the
- operation. Read moreSource§impl Sub<DurationMillis> for TimestampMillis
impl Sub<DurationMillis> for TimestampMillis
Source§type Output = TimestampMillis
type Output = TimestampMillis
The resulting type after applying the
- operator.Source§fn sub(
self,
rhs: DurationMillis,
) -> <TimestampMillis as Sub<DurationMillis>>::Output
fn sub( self, rhs: DurationMillis, ) -> <TimestampMillis as Sub<DurationMillis>>::Output
Performs the
- operation. Read moreSource§impl TopDecode for TimestampMillis
impl TopDecode for TimestampMillis
Source§fn top_decode_or_handle_err<I, H>(
input: I,
h: H,
) -> Result<TimestampMillis, <H as DecodeErrorHandler>::HandledErr>where
I: TopDecodeInput,
H: DecodeErrorHandler,
fn top_decode_or_handle_err<I, H>(
input: I,
h: H,
) -> Result<TimestampMillis, <H as DecodeErrorHandler>::HandledErr>where
I: TopDecodeInput,
H: DecodeErrorHandler,
Version of
top_decode that can handle errors as soon as they occur.
For instance it can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn top_decode<I>(input: I) -> Result<Self, DecodeError>where
I: TopDecodeInput,
fn top_decode<I>(input: I) -> Result<Self, DecodeError>where
I: TopDecodeInput,
Attempt to deserialize the value from input.
Source§impl TopEncode for TimestampMillis
impl TopEncode for TimestampMillis
Source§fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
Version of
top_encode that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where
O: TopEncodeOutput,
fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where
O: TopEncodeOutput,
Attempt to serialize the value to output.
Source§impl TypeAbi for TimestampMillis
impl TypeAbi for TimestampMillis
type Unmanaged = TimestampMillis
Source§fn type_name_rust() -> TypeName
fn type_name_rust() -> TypeName
The type name as it shows up in Rust code. Used for proxies. Read more
Source§fn type_name_specific() -> Option<TypeName>
fn type_name_specific() -> Option<TypeName>
Specific name to be optionally added to the ABI. Read more
fn type_names() -> TypeNames
Source§fn provide_type_descriptions<TDC: TypeDescriptionContainer>(
accumulator: &mut TDC,
)
fn provide_type_descriptions<TDC: TypeDescriptionContainer>( accumulator: &mut TDC, )
A type can provide more than its own name.
For instance, a struct can also provide the descriptions of the type of its fields.
TypeAbi doesn’t care for the exact accumulator type,
which is abstracted by the TypeDescriptionContainer trait.
impl TypeAbiFrom<TimestampMillis> for TimestampMillis
Auto Trait Implementations§
impl Freeze for TimestampMillis
impl RefUnwindSafe for TimestampMillis
impl Send for TimestampMillis
impl Sync for TimestampMillis
impl Unpin for TimestampMillis
impl UnsafeUnpin for TimestampMillis
impl UnwindSafe for TimestampMillis
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> MultiValueConstLength for T
impl<T> MultiValueConstLength for T
Source§const MULTI_VALUE_CONST_LEN: usize = 1
const MULTI_VALUE_CONST_LEN: usize = 1
The fixed (constant) number of single items contained a multi-value. Read more
Source§impl<T> MultiValueLength for T
impl<T> MultiValueLength for T
Source§fn multi_value_len(&self) -> usize
fn multi_value_len(&self) -> usize
The number of single items contained a multi-value.
impl<O, T> ProxyArg<O> for Twhere
O: TypeAbiFrom<T>,
T: TopEncodeMulti,
Source§impl<T> SCCodec for Twhere
T: TopEncode,
impl<T> SCCodec for Twhere
T: TopEncode,
fn fmt<F>(&self, f: &mut F)where
F: FormatByteReceiver,
Source§impl<T> TopDecodeMulti for Twhere
T: TopDecode,
impl<T> TopDecodeMulti for Twhere
T: TopDecode,
Source§const IS_SINGLE_VALUE: bool = true
const IS_SINGLE_VALUE: bool = true
Used to optimize single value loading of endpoint arguments.
fn multi_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<T, <H as DecodeErrorHandler>::HandledErr>where
I: TopDecodeMultiInput,
H: DecodeErrorHandler,
fn multi_decode<I>(input: &mut I) -> Result<Self, DecodeError>where
I: TopDecodeMultiInput,
Source§impl<T> TopEncodeMulti for Twhere
T: TopEncode,
impl<T> TopEncodeMulti for Twhere
T: TopEncode,
Source§fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
Version of
top_encode that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.Source§fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
Attempt to serialize the value to output.