Struct aws_lambda_events::encodings::SecondDuration
source · [−]pub struct SecondDuration(pub Duration);
Expand description
Duration with second precision.
Tuple Fields
0: Duration
Methods from Deref<Target = Duration>
sourcepub fn num_minutes(&self) -> i64
pub fn num_minutes(&self) -> i64
Returns the total number of whole minutes in the duration.
sourcepub fn num_seconds(&self) -> i64
pub fn num_seconds(&self) -> i64
Returns the total number of whole seconds in the duration.
sourcepub fn num_milliseconds(&self) -> i64
pub fn num_milliseconds(&self) -> i64
Returns the total number of whole milliseconds in the duration,
sourcepub fn num_microseconds(&self) -> Option<i64>
pub fn num_microseconds(&self) -> Option<i64>
Returns the total number of whole microseconds in the duration,
or None
on overflow (exceeding 263 microseconds in either direction).
sourcepub fn num_nanoseconds(&self) -> Option<i64>
pub fn num_nanoseconds(&self) -> Option<i64>
Returns the total number of whole nanoseconds in the duration,
or None
on overflow (exceeding 263 nanoseconds in either direction).
sourcepub fn checked_add(&self, rhs: &Duration) -> Option<Duration>
pub fn checked_add(&self, rhs: &Duration) -> Option<Duration>
Add two durations, returning None
if overflow occurred.
sourcepub fn checked_sub(&self, rhs: &Duration) -> Option<Duration>
pub fn checked_sub(&self, rhs: &Duration) -> Option<Duration>
Subtract two durations, returning None
if overflow occurred.
sourcepub fn to_std(&self) -> Result<Duration, OutOfRangeError>
pub fn to_std(&self) -> Result<Duration, OutOfRangeError>
Creates a std::time::Duration
object from time::Duration
This function errors when duration is less than zero. As standard library implementation is limited to non-negative values.
Trait Implementations
sourceimpl Clone for SecondDuration
impl Clone for SecondDuration
sourcefn clone(&self) -> SecondDuration
fn clone(&self) -> SecondDuration
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SecondDuration
impl Debug for SecondDuration
sourceimpl Deref for SecondDuration
impl Deref for SecondDuration
sourceimpl DerefMut for SecondDuration
impl DerefMut for SecondDuration
sourceimpl<'de> Deserialize<'de> for SecondDuration
impl<'de> Deserialize<'de> for SecondDuration
sourcefn 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
sourceimpl PartialEq<SecondDuration> for SecondDuration
impl PartialEq<SecondDuration> for SecondDuration
sourcefn eq(&self, other: &SecondDuration) -> bool
fn eq(&self, other: &SecondDuration) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SecondDuration) -> bool
fn ne(&self, other: &SecondDuration) -> bool
This method tests for !=
.
sourceimpl Serialize for SecondDuration
impl Serialize for SecondDuration
impl StructuralPartialEq for SecondDuration
Auto Trait Implementations
impl RefUnwindSafe for SecondDuration
impl Send for SecondDuration
impl Sync for SecondDuration
impl Unpin for SecondDuration
impl UnwindSafe for SecondDuration
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more