pub struct Window {
pub offset: Duration,
/* private fields */
}
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) -> Self
Sourcepub fn truncate_ns(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
pub fn truncate_ns(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
Truncate the given ns timestamp by the window boundary.
Sourcepub fn truncate_us(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
pub fn truncate_us(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
Truncate the given us timestamp by the window boundary.
Sourcepub fn truncate_ms(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
pub fn truncate_ms(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
Truncate the given ms timestamp by the window boundary.
Sourcepub fn round_ns(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
pub fn round_ns(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
Round the given ns timestamp by the window boundary.
Sourcepub fn round_us(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
pub fn round_us(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
Round the given us timestamp by the window boundary.
Sourcepub fn round_ms(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
pub fn round_ms(&self, t: i64, tz: Option<&Tz>) -> PolarsResult<i64>
Round the given ms timestamp by the window boundary.
Sourcepub fn get_earliest_bounds_ns(
&self,
t: i64,
closed_window: ClosedWindow,
tz: Option<&Tz>,
) -> PolarsResult<Bounds>
pub fn get_earliest_bounds_ns( &self, t: i64, closed_window: ClosedWindow, tz: Option<&Tz>, ) -> PolarsResult<Bounds>
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>, ) -> PolarsResult<Bounds>
pub fn get_earliest_bounds_ms( &self, t: i64, closed_window: ClosedWindow, tz: Option<&Tz>, ) -> PolarsResult<Bounds>
pub fn get_overlapping_bounds_iter<'a>( &'a self, boundary: Bounds, closed_window: ClosedWindow, tu: TimeUnit, tz: Option<&'a Tz>, start_by: StartBy, ) -> PolarsResult<BoundsIter<'a>>
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§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