pub struct Interval {
pub alignment_unit: Option<AlignmentUnit>,
pub size: IntervalSize,
}Fields§
§alignment_unit: Option<AlignmentUnit>Used if the IntervalSize is Temporal, keeps track of the smallest unit passed to line up windows.
(eg. at the start of the hour, week, year, …). If the IntervalSize is discrete, this is None.
size: IntervalSizeThe interval.
Implementations§
Source§impl Interval
impl Interval
Sourcepub fn to_millis(&self) -> Option<u64>
pub fn to_millis(&self) -> Option<u64>
Return an option because there might be no exact translation to millis for some intervals
pub fn discrete(num: u64) -> Self
pub fn milliseconds(ms: i64) -> Self
pub fn seconds(seconds: i64) -> Self
pub fn minutes(minutes: i64) -> Self
pub fn hours(hours: i64) -> Self
pub fn days(days: i64) -> Self
pub fn weeks(weeks: i64) -> Self
pub fn months(months: i64) -> Self
pub fn years(years: i64) -> Self
pub fn and(&self, other: &Self) -> Result<Self, IntervalTypeError>
Trait Implementations§
impl Copy for Interval
impl StructuralPartialEq for Interval
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin for Interval
impl UnwindSafe for Interval
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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