pub struct Schedule { /* private fields */ }Expand description
Recurring schedule for permissions.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn new(
weekdays: Vec<Weekday>,
start_time: NaiveTime,
end_time: NaiveTime,
timezone: String,
) -> Self
pub fn new( weekdays: Vec<Weekday>, start_time: NaiveTime, end_time: NaiveTime, timezone: String, ) -> Self
Create a new schedule.
Sourcepub fn business_hours(timezone: String) -> Self
pub fn business_hours(timezone: String) -> Self
Create a business hours schedule (Monday-Friday, 9 AM - 5 PM).
Sourcepub fn is_valid_at(&self, time: DateTime<Utc>) -> bool
pub fn is_valid_at(&self, time: DateTime<Utc>) -> bool
Check if the schedule is valid at the given time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnwindSafe for Schedule
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