Struct nettu_scheduler_domain::ServiceResource [−][src]
pub struct ServiceResource { pub id: ID, pub user_id: ID, pub availibility: TimePlan, pub busy: Vec<ID>, 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<ID>
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]
pub fn new(user_id: ID, availibility: TimePlan, busy: Vec<ID>) -> Self
[src]
pub fn set_availibility(&mut self, availibility: TimePlan)
[src]
pub fn set_busy(&mut self, busy: Vec<ID>)
[src]
pub fn set_buffer(&mut self, buffer: i64) -> bool
[src]
pub fn get_calendar_ids(&self) -> Vec<ID>
[src]
pub fn get_schedule_id(&self) -> Option<ID>
[src]
pub fn contains_calendar(&self, calendar_id: &ID) -> bool
[src]
pub fn remove_calendar(&mut self, calendar_id: &ID)
[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]
fn clone(&self) -> ServiceResource
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,