pub struct Assignment {
pub activity_id: String,
pub task_id: String,
pub resource_id: String,
pub start_ms: i64,
pub end_ms: i64,
pub setup_ms: i64,
}Expand description
An activity-resource-time assignment.
Records that a specific activity is scheduled on a specific resource during a specific time interval.
Fields§
§activity_id: StringAssigned activity ID.
task_id: StringParent task ID (denormalized for query convenience).
resource_id: StringAssigned resource ID.
start_ms: i64Start time (ms).
end_ms: i64End time (ms).
setup_ms: i64Setup time portion (ms). Included in [start_ms, start_ms + setup_ms).
Implementations§
Source§impl Assignment
impl Assignment
Sourcepub fn new(
activity_id: impl Into<String>,
task_id: impl Into<String>,
resource_id: impl Into<String>,
start_ms: i64,
end_ms: i64,
) -> Self
pub fn new( activity_id: impl Into<String>, task_id: impl Into<String>, resource_id: impl Into<String>, start_ms: i64, end_ms: i64, ) -> Self
Creates a new assignment.
Sourcepub fn with_setup(self, setup_ms: i64) -> Self
pub fn with_setup(self, setup_ms: i64) -> Self
Sets the setup time.
Sourcepub fn duration_ms(&self) -> i64
pub fn duration_ms(&self) -> i64
Total duration (end - start) in ms.
Sourcepub fn process_ms(&self) -> i64
pub fn process_ms(&self) -> i64
Processing duration excluding setup (ms).
Trait Implementations§
Source§impl Clone for Assignment
impl Clone for Assignment
Source§fn clone(&self) -> Assignment
fn clone(&self) -> Assignment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Assignment
impl Debug for Assignment
Source§impl<'de> Deserialize<'de> for Assignment
impl<'de> Deserialize<'de> for Assignment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Assignment
impl RefUnwindSafe for Assignment
impl Send for Assignment
impl Sync for Assignment
impl Unpin for Assignment
impl UnsafeUnpin for Assignment
impl UnwindSafe for Assignment
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