pub struct Activity {
pub place: Place,
pub schedule: Schedule,
pub job: Option<Arc<Single>>,
pub commute: Option<Commute>,
}
Expand description
Represents activity which is needed to be performed.
Fields§
§place: Place
Specifies activity details.
schedule: Schedule
Specifies activity’s schedule including commute time.
job: Option<Arc<Single>>
Specifies associated job. Empty if it has no association with a single job (e.g. tour start or end).
If single job is part of multi job, then original job can be received via retrieve_job
method.
commute: Option<Commute>
An extra commute time to the place.
Implementations§
source§impl Activity
impl Activity
sourcepub fn new_with_job(job: Arc<Single>) -> Self
pub fn new_with_job(job: Arc<Single>) -> Self
Creates an activity with a job.
sourcepub fn has_same_job(&self, job: &Job) -> bool
pub fn has_same_job(&self, job: &Job) -> bool
Checks whether activity has given job.
sourcepub fn retrieve_job(&self) -> Option<Job>
pub fn retrieve_job(&self) -> Option<Job>
Returns job if activity has it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Activity
impl !RefUnwindSafe for Activity
impl Send for Activity
impl Sync for Activity
impl Unpin for Activity
impl !UnwindSafe for Activity
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
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