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.
pub fn truncate_no_offset_ns( &self, t: i64, tz: Option<&Tz> ) -> Result<i64, PolarsError>
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.
pub fn truncate_no_offset_us( &self, t: i64, tz: Option<&Tz> ) -> Result<i64, PolarsError>
pub fn truncate_ms(&self, t: i64, tz: Option<&Tz>) -> Result<i64, PolarsError>
pub fn truncate_no_offset_ms( &self, t: i64, tz: Option<&Tz> ) -> Result<i64, PolarsError>
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,
tz: Option<&Tz>
) -> Result<Bounds, PolarsError>
pub fn get_earliest_bounds_ns( &self, t: i64, 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, tz: Option<&Tz> ) -> Result<Bounds, PolarsError>
pub fn get_earliest_bounds_ms( &self, t: i64, tz: Option<&Tz> ) -> Result<Bounds, PolarsError>
pub fn get_overlapping_bounds_iter<'a>( &'a self, boundary: Bounds, tu: TimeUnit, tz: Option<&'a Tz>, start_by: StartBy ) -> Result<BoundsIter<'a>, PolarsError>
Trait Implementations§
Auto Trait Implementations§
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