pub struct UnixTimestampMicros(pub i64);Tuple Fields§
§0: i64Implementations§
Source§impl UnixTimestampMicros
impl UnixTimestampMicros
pub const ZERO: Self
pub fn from_secs(secs: i64) -> Result<Self, ArithmeticError>
pub fn from_secs_u32(secs: u32) -> Self
pub fn from_micros(micros: i64) -> Self
pub fn from_millis(millis: i64) -> Result<Self, ArithmeticError>
pub fn from_nanos(nanos: u128) -> Result<Self, ArithmeticError>
pub fn as_secs(&self) -> i64
pub fn as_micros(&self) -> i64
pub fn as_hour(&self) -> i64
pub fn checked_add_secs(&self, other: i64) -> Result<Self, ArithmeticError>
pub fn checked_add( &self, other: UnixTimestampMicros, ) -> Result<Self, ArithmeticError>
Sourcepub fn elapsed_micros(self, other: UnixTimestampMicros) -> i64
pub fn elapsed_micros(self, other: UnixTimestampMicros) -> i64
Returns the microseconds elapsed. Or zero on errors.
Sourcepub fn elapsed_secs(self, other: UnixTimestampMicros) -> u64
pub fn elapsed_secs(self, other: UnixTimestampMicros) -> u64
Returns the seconds elapsed. Or zero on errors.
Trait Implementations§
Source§impl BorshDeserialize for UnixTimestampMicros
impl BorshDeserialize for UnixTimestampMicros
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for UnixTimestampMicros
impl BorshSerialize for UnixTimestampMicros
Source§impl Clone for UnixTimestampMicros
impl Clone for UnixTimestampMicros
Source§fn clone(&self) -> UnixTimestampMicros
fn clone(&self) -> UnixTimestampMicros
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 Debug for UnixTimestampMicros
impl Debug for UnixTimestampMicros
Source§impl Default for UnixTimestampMicros
impl Default for UnixTimestampMicros
Source§fn default() -> UnixTimestampMicros
fn default() -> UnixTimestampMicros
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UnixTimestampMicros
impl<'de> Deserialize<'de> for UnixTimestampMicros
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for UnixTimestampMicros
impl Display for UnixTimestampMicros
Source§impl FromStr for UnixTimestampMicros
impl FromStr for UnixTimestampMicros
Source§impl Hash for UnixTimestampMicros
impl Hash for UnixTimestampMicros
Source§impl JsonSchema for UnixTimestampMicros
impl JsonSchema for UnixTimestampMicros
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§impl Ord for UnixTimestampMicros
impl Ord for UnixTimestampMicros
Source§fn cmp(&self, other: &UnixTimestampMicros) -> Ordering
fn cmp(&self, other: &UnixTimestampMicros) -> Ordering
1.21.0 · 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 UnixTimestampMicros
impl PartialEq for UnixTimestampMicros
Source§impl PartialOrd for UnixTimestampMicros
impl PartialOrd for UnixTimestampMicros
Source§impl Serialize for UnixTimestampMicros
impl Serialize for UnixTimestampMicros
impl Copy for UnixTimestampMicros
impl Eq for UnixTimestampMicros
impl StructuralPartialEq for UnixTimestampMicros
Auto Trait Implementations§
impl Freeze for UnixTimestampMicros
impl RefUnwindSafe for UnixTimestampMicros
impl Send for UnixTimestampMicros
impl Sync for UnixTimestampMicros
impl Unpin for UnixTimestampMicros
impl UnsafeUnpin for UnixTimestampMicros
impl UnwindSafe for UnixTimestampMicros
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