pub struct Duration {
pub parsed_int: bool,
/* private fields */
}
Fields
parsed_int: bool
Implementations
sourceimpl Duration
impl Duration
sourcepub fn parse(duration: &str) -> Duration
pub fn parse(duration: &str) -> Duration
1ns // 1 nanosecond 1us // 1 microsecond 1ms // 1 millisecond 1s // 1 second 1m // 1 minute 1h // 1 hour 1d // 1 day 1w // 1 week 1mo // 1 calendar month 1y // 1 calendar year 1i // 1 index value (only for {Int32, Int64} dtypes
3d12h4m25s // 3 days, 12 hours, 4 minutes, and 25 seconds
Panics if given str is incorrect
pub fn months_only(&self) -> bool
pub fn months(&self) -> i64
pub fn nanoseconds(&self) -> i64
pub fn truncate_impl<F, G, J>(
&self,
t: i64,
nsecs_to_unit: F,
timestamp_to_datetime: G,
datetime_to_timestamp: J
) -> i64where
F: Fn(i64) -> i64,
G: Fn(i64) -> NaiveDateTime,
J: Fn(NaiveDateTime) -> i64,
pub fn truncate_ns(&self, t: i64) -> i64
pub fn truncate_us(&self, t: i64) -> i64
pub fn truncate_ms(&self, t: i64) -> i64
pub fn add_ns(&self, t: i64) -> i64
pub fn add_us(&self, t: i64) -> i64
pub fn add_ms(&self, t: i64) -> i64
Trait Implementations
sourceimpl Ord for Duration
impl Ord for Duration
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Duration> for Duration
impl PartialOrd<Duration> for Duration
sourcefn partial_cmp(&self, other: &Duration) -> Option<Ordering>
fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Duration
impl Eq for Duration
impl StructuralEq for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.