Struct polars_time::prelude::Duration
source · [−]pub struct Duration {
pub parsed_int: bool,
/* private fields */
}
Fields
parsed_int: bool
Implementations
sourceimpl Duration
impl Duration
sourcepub fn parse(duration: &str) -> Self
pub fn parse(duration: &str) -> Self
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(&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
) -> i64 where
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
impl Copy 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 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> Pointable for T
impl<T> Pointable for T
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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more