pub struct CapacityBooking {
pub id: CapacityBookingId,
pub execution: TransportExecutionId,
pub resource: String,
pub valid_from: SimTime,
pub valid_until: SimTime,
pub quantity: u64,
pub priority: i32,
pub status: CapacityBookingStatus,
pub allocation_evidence: Vec<EvidenceRef>,
}Fields§
§id: CapacityBookingId§execution: TransportExecutionId§resource: String§valid_from: SimTime§valid_until: SimTime§quantity: u64§priority: i32§status: CapacityBookingStatus§allocation_evidence: Vec<EvidenceRef>Implementations§
Source§impl CapacityBooking
impl CapacityBooking
pub fn new( id: CapacityBookingId, execution: TransportExecutionId, resource: String, valid_from: SimTime, valid_until: SimTime, quantity: u64, priority: i32, ) -> Result<CapacityBooking, TransportError>
Sourcepub fn transition(
&mut self,
status: CapacityBookingStatus,
at: SimTime,
) -> Result<(), TransportError>
pub fn transition( &mut self, status: CapacityBookingStatus, at: SimTime, ) -> Result<(), TransportError>
Moves the booking through its windowed state machine.
A request may be confirmed, failed, or cancelled, and a confirmed booking released or cancelled, before its window opens; capacity can only be consumed inside the window, confirmed only until it ends, and expired only after it ends.
Trait Implementations§
Source§impl Clone for CapacityBooking
impl Clone for CapacityBooking
Source§fn clone(&self) -> CapacityBooking
fn clone(&self) -> CapacityBooking
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CapacityBooking
impl Debug for CapacityBooking
Source§impl<'de> Deserialize<'de> for CapacityBooking
impl<'de> Deserialize<'de> for CapacityBooking
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CapacityBooking, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CapacityBooking, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CapacityBooking
Source§impl PartialEq for CapacityBooking
impl PartialEq for CapacityBooking
Source§impl Serialize for CapacityBooking
impl Serialize for CapacityBooking
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for CapacityBooking
Auto Trait Implementations§
impl Freeze for CapacityBooking
impl RefUnwindSafe for CapacityBooking
impl Send for CapacityBooking
impl Sync for CapacityBooking
impl Unpin for CapacityBooking
impl UnsafeUnpin for CapacityBooking
impl UnwindSafe for CapacityBooking
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