pub struct Window {
pub offset: Duration,
/* private fields */
}
Available on crate feature
temporal
only.Expand description
Represents a window in time
Fields§
§offset: Duration
Implementations§
Source§impl Window
impl Window
pub fn new(every: Duration, period: Duration, offset: Duration) -> Window
Sourcepub fn truncate_ns(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
pub fn truncate_ns(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
Truncate the given ns timestamp by the window boundary.
Sourcepub fn truncate_us(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
pub fn truncate_us(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
Truncate the given us timestamp by the window boundary.
Sourcepub fn truncate_ms(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
pub fn truncate_ms(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
Truncate the given ms timestamp by the window boundary.
Sourcepub fn round_ns(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
pub fn round_ns(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
Round the given ns timestamp by the window boundary.
Sourcepub fn round_us(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
pub fn round_us(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
Round the given us timestamp by the window boundary.
Sourcepub fn round_ms(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
pub fn round_ms(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
Round the given ms timestamp by the window boundary.
Sourcepub fn get_earliest_bounds_ns(
&self,
t: i64,
closed_window: ClosedWindow,
tz: Option<&Tz>,
) -> Result<Bounds, PolarsError>
pub fn get_earliest_bounds_ns( &self, t: i64, closed_window: ClosedWindow, tz: Option<&Tz>, ) -> Result<Bounds, PolarsError>
returns the bounds for the earliest window bounds that contains the given time t. For underlapping windows that do not contain time t, the window directly after time t will be returned.
pub fn get_earliest_bounds_us( &self, t: i64, closed_window: ClosedWindow, tz: Option<&Tz>, ) -> Result<Bounds, PolarsError>
pub fn get_earliest_bounds_ms( &self, t: i64, closed_window: ClosedWindow, tz: Option<&Tz>, ) -> Result<Bounds, PolarsError>
pub fn get_overlapping_bounds_iter<'a>( &'a self, boundary: Bounds, closed_window: ClosedWindow, tu: TimeUnit, tz: Option<&'a Tz>, start_by: StartBy, ) -> Result<BoundsIter<'a>, PolarsError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Window
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnwindSafe for Window
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more