#[non_exhaustive]pub struct ScheduleManager { /* private fields */ }Expand description
Evaluates global and per-folder schedules.
Implementations§
Source§impl ScheduleManager
impl ScheduleManager
Sourcepub fn from_config(config: &ScheduleConfig) -> Result<Self>
pub fn from_config(config: &ScheduleConfig) -> Result<Self>
Parse a schedule configuration.
§Errors
Returns an error if a schedule interval or bandwidth rate is invalid.
Sourcepub fn is_active(&self, folder: Option<&str>) -> bool
pub fn is_active(&self, folder: Option<&str>) -> bool
Return whether a folder is active at the current local wall-clock time.
Sourcepub fn is_active_at(&self, folder: Option<&str>, minute: u16) -> bool
pub fn is_active_at(&self, folder: Option<&str>, minute: u16) -> bool
Return whether a folder is active at a supplied minute after midnight.
Sourcepub fn current_limits(&self, folder: Option<&str>) -> BandwidthLimits
pub fn current_limits(&self, folder: Option<&str>) -> BandwidthLimits
Return the limits for a folder at the current local wall-clock time.
Sourcepub fn current_limits_at(
&self,
folder: Option<&str>,
minute: u16,
) -> BandwidthLimits
pub fn current_limits_at( &self, folder: Option<&str>, minute: u16, ) -> BandwidthLimits
Return the limits for a folder at a supplied minute after midnight.
Sourcepub fn next_active_window_start_at(
&self,
folder: Option<&str>,
minute: u16,
) -> Option<u16>
pub fn next_active_window_start_at( &self, folder: Option<&str>, minute: u16, ) -> Option<u16>
Return the next minute at which the selected schedule becomes active.
pub const fn global(&self) -> &Schedule
Trait Implementations§
Source§impl Clone for ScheduleManager
impl Clone for ScheduleManager
Auto Trait Implementations§
impl Freeze for ScheduleManager
impl RefUnwindSafe for ScheduleManager
impl Send for ScheduleManager
impl Sync for ScheduleManager
impl Unpin for ScheduleManager
impl UnsafeUnpin for ScheduleManager
impl UnwindSafe for ScheduleManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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