pub struct WeeklySessionProvider {
pub break_day: Weekday,
}Expand description
Weekly session provider that detects boundaries after a configured UTC weekday.
Defaults to Sunday, so a week starts on Monday. Configure with
new to use a different day.
Fields§
§break_day: WeekdayLast weekday of the session week; the break is at the following midnight UTC.
Implementations§
Trait Implementations§
Source§impl Clone for WeeklySessionProvider
impl Clone for WeeklySessionProvider
Source§fn clone(&self) -> WeeklySessionProvider
fn clone(&self) -> WeeklySessionProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeeklySessionProvider
impl Debug for WeeklySessionProvider
Source§impl Default for WeeklySessionProvider
impl Default for WeeklySessionProvider
Source§impl SessionProvider for WeeklySessionProvider
impl SessionProvider for WeeklySessionProvider
Source§fn session_break_between(
&self,
from: &DateTime<Utc>,
to: &DateTime<Utc>,
) -> Option<SessionBreak>
fn session_break_between( &self, from: &DateTime<Utc>, to: &DateTime<Utc>, ) -> Option<SessionBreak>
Check if a session break occurs between two ts
Returns Some(SessionBreak) if there’s a break, None otherwise
Source§fn session_breaks_in_range(
&self,
start: &DateTime<Utc>,
end: &DateTime<Utc>,
) -> Vec<SessionBreak>
fn session_breaks_in_range( &self, start: &DateTime<Utc>, end: &DateTime<Utc>, ) -> Vec<SessionBreak>
Get all session breaks within a time range, checking at most one minute at a time.
The final check stops at
end; an empty or reversed range has no breaks.Source§fn session_breaks(&self, bars: &[Bar]) -> Vec<(usize, SessionBreak)>
fn session_breaks(&self, bars: &[Bar]) -> Vec<(usize, SessionBreak)>
The breaks between consecutive
bars, as find_session_breaks returns them. The
default asks session_break_between for each pair; a
provider can find them in one pass instead.Auto Trait Implementations§
impl Freeze for WeeklySessionProvider
impl RefUnwindSafe for WeeklySessionProvider
impl Send for WeeklySessionProvider
impl Sync for WeeklySessionProvider
impl Unpin for WeeklySessionProvider
impl UnsafeUnpin for WeeklySessionProvider
impl UnwindSafe for WeeklySessionProvider
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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