Struct serde_amqp::primitives::Timestamp
source · pub struct Timestamp(/* private fields */);
Expand description
An absolute point in time
encoding name = “ms64”, code = 0x83, category = fixed, width = 8 label = “64-bit two’s-complement integer representing milliseconds since the unix epoch” 64-bit two’s-complement integer representing milliseconds since the unix epoch
Implementations§
source§impl Timestamp
impl Timestamp
sourcepub fn from_milliseconds(milliseconds: i64) -> Self
pub fn from_milliseconds(milliseconds: i64) -> Self
Creates a new Timestamp
from milliseconds
sourcepub fn milliseconds(&self) -> i64
pub fn milliseconds(&self) -> i64
Get the timestamp value as milliseconds
Trait Implementations§
source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
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 From<Duration> for Timestamp
Available on crate feature time
only.
impl From<Duration> for Timestamp
time
only.Please note that this conversion does NOT check for overflow
source§impl From<OffsetDateTime> for Timestamp
Available on crate feature time
only.
impl From<OffsetDateTime> for Timestamp
time
only.Please note that this conversion does NOT check for overflow
source§fn from(val: OffsetDateTime) -> Self
fn from(val: OffsetDateTime) -> Self
source§impl From<Timestamp> for OffsetDateTime
Available on crate feature time
only.
impl From<Timestamp> for OffsetDateTime
time
only.source§impl From<Timestamp> for Option<DateTime<Utc>>
Available on crate feature chrono
only.
impl From<Timestamp> for Option<DateTime<Utc>>
chrono
only.source§fn from(value: Timestamp) -> Self
fn from(value: Timestamp) -> Self
Conversion from Timestamp
to chrono::DateTime<chrono::Utc>
is fallible. A None
will be returned if the timestamp is out of range of chrono::DateTime<chrono::Utc>
This preview feature is to reflect upstream changes in chrono
that deprecates
from_timestamp()
.
Conversion between Timestamp
to DateTime<Utc>
using From::from
is still available if
only the “chrono” feature is enabled without the “chrono-preview” feature, and it will be
removed in favour of the one provided with the “chrono-preview” feature in the next major
version.
source§impl Ord for Timestamp
impl Ord for Timestamp
source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
source§impl TryFrom<Timestamp> for DateTime<Utc>
Available on crate feature chrono
only.
impl TryFrom<Timestamp> for DateTime<Utc>
chrono
only.source§fn try_from(value: Timestamp) -> Result<Self, Self::Error>
fn try_from(value: Timestamp) -> Result<Self, Self::Error>
Conversion from Timestamp
to chrono::DateTime<chrono::Utc>
is fallible. An error
will be returned if the timestamp is out of range for chrono::DateTime<chrono::Utc>
.
This preview feature is to reflect upstream changes in chrono
that deprecates
from_timestamp()
.
Conversion between Timestamp
to DateTime<Utc>
using From::from
is still available if
only the “chrono” feature is enabled without the “chrono-preview” feature, and it will be
removed in favour of the one provided with the “chrono-preview” feature in the next major
version.
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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
key
and return true
if they are equal.