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: IDuser_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 CalendarEvents 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]

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]

fn clone(&self) -> ServiceResource[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ServiceResource[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Serialize for ServiceResource[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 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<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V