Struct nettu_scheduler_domain::ServiceResource [−][src]
pub struct ServiceResource { pub id: ID, pub user_id: ID, pub availibility: TimePlan, pub busy: Vec<BusyCalendar>, pub buffer: i64, pub closest_booking_time: i64, pub furthest_booking_time: Option<i64>, }
A bookable User
registered on a Service
Fields
id: ID
user_id: ID
Id of the User
registered on this Service
availibility: TimePlan
Every available event in a Calendar
or a Shedule
in this field
describes the time when this ServiceResource
will be bookable.
Note: If there are busy CalendarEvent
s in the Calendar
then the user
will not be bookable during that time.
busy: Vec<BusyCalendar>
List of Calendar
ids that should be subtracted from the availibility
time plan.
buffer: i64
This ServiceResource
will not be bookable this amount of minutes
after a meeting. A CalendarEvent
will be interpreted as a meeting
if the attribute services
on the CalendarEvent
includes this
Service
id or “*”.
closest_booking_time: i64
Minimum amount of time in minutes before this user could receive any
booking requests. That means that if a bookingslots query is made at
time T then this ServiceResource
will not have any availaible
bookingslots before at least T + closest_booking_time
furthest_booking_time: Option<i64>
Amount of time in minutes into the future after which the user can not receive any
booking requests. This is useful to ensure that booking requests are not made multiple
years into the future. That means that if a bookingslots query is made at
time T then this ServiceResource
will not have any availaible
bookingslots after T + furthest_booking_time
Implementations
impl ServiceResource
[src]
impl ServiceResource
[src]pub fn new(user_id: ID, availibility: TimePlan, busy: Vec<BusyCalendar>) -> Self
[src]
pub fn set_availibility(&mut self, availibility: TimePlan)
[src]
pub fn set_busy(&mut self, busy: Vec<BusyCalendar>)
[src]
pub fn set_buffer(&mut self, buffer: i64) -> bool
[src]
pub fn get_schedule_id(&self) -> Option<ID>
[src]
pub fn contains_calendar(&self, calendar_id: &str) -> bool
[src]
pub fn remove_calendar(&mut self, calendar_id: &str)
[src]
pub fn contains_schedule(&self, schedule_id: &ID) -> bool
[src]
pub fn remove_schedule(&mut self, schedule_id: &ID)
[src]
Trait Implementations
impl Clone for ServiceResource
[src]
impl Clone for ServiceResource
[src]fn clone(&self) -> ServiceResource
[src]
fn clone(&self) -> ServiceResource
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ServiceResource
[src]
impl Debug for ServiceResource
[src]impl Serialize for ServiceResource
[src]
impl Serialize for ServiceResource
[src]Auto Trait Implementations
impl RefUnwindSafe for ServiceResource
impl Send for ServiceResource
impl Sync for ServiceResource
impl Unpin for ServiceResource
impl UnwindSafe for ServiceResource
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,