pub struct TransportExecution {
pub id: TransportExecutionId,
pub delivery_attempt: Option<DomainRecordVersionRef>,
pub state: TransportExecutionState,
pub active_itinerary_revision: Option<ItineraryRevisionId>,
pub current_leg_index: usize,
pub estimated_arrival_at: Option<SimTime>,
pub current_endpoint: Option<String>,
pub revisions: Vec<ItineraryRevision>,
pub legs: Vec<LegExecution>,
pub handoffs: Vec<Handoff>,
pub bookings: Vec<CapacityBooking>,
pub saga: Option<DeliverySaga>,
}Fields§
§id: TransportExecutionId§delivery_attempt: Option<DomainRecordVersionRef>§state: TransportExecutionState§active_itinerary_revision: Option<ItineraryRevisionId>§current_leg_index: usize§estimated_arrival_at: Option<SimTime>§current_endpoint: Option<String>§revisions: Vec<ItineraryRevision>§legs: Vec<LegExecution>§handoffs: Vec<Handoff>§bookings: Vec<CapacityBooking>§saga: Option<DeliverySaga>Implementations§
Source§impl TransportExecution
impl TransportExecution
pub fn new( id: TransportExecutionId, delivery_attempt: Option<DomainRecordVersionRef>, ) -> TransportExecution
pub fn install_initial_itinerary( &mut self, revision: ItineraryRevision, ) -> Result<(), TransportError>
pub fn reroute( &mut self, revision: ItineraryRevision, at: SimTime, ) -> Result<(), TransportError>
pub fn begin_saga( &mut self, delivery_attempt: DomainRecordVersionRef, operation_key: String, ) -> Result<(), TransportError>
pub fn start_current_leg(&mut self, at: SimTime) -> Result<(), TransportError>
pub fn complete_current_leg( &mut self, at: SimTime, endpoint: String, ) -> Result<bool, TransportError>
pub fn fail_current_leg( &mut self, reason: String, at: SimTime, ) -> Result<(), TransportError>
pub fn mark_arrival_pending(&mut self) -> Result<(), TransportError>
pub fn record_handoff(&mut self, handoff: Handoff) -> Result<(), TransportError>
Sourcepub fn custody_left_itinerary(&self) -> bool
pub fn custody_left_itinerary(&self) -> bool
Whether a terminal seizure has taken custody out of the itinerary.
Such an execution cannot fail or reroute a leg, arrive, settle
successfully, book capacity, or record another handoff. Its owner
closes it: an execution with a delivery saga through
Self::reconcile_information with a failure, which leaves it
Failed, and one without a saga through Self::cancel.
Sourcepub fn request_booking(
&mut self,
booking: CapacityBooking,
) -> Result<(), TransportError>
pub fn request_booking( &mut self, booking: CapacityBooking, ) -> Result<(), TransportError>
Adds one requested capacity booking to this execution.
The booking must name this execution, still be Requested, carry no
allocation evidence, and have an identity unique within the execution.
A terminal execution accepts no further bookings.
Sourcepub fn settle_arrival(
&mut self,
at: SimTime,
endpoint: String,
) -> Result<(), TransportError>
pub fn settle_arrival( &mut self, at: SimTime, endpoint: String, ) -> Result<(), TransportError>
Completes the final departed leg of an execution that carries no delivery attempt and settles it.
A movement that does not complete an information delivery has nothing
to reconcile, so arrival is its terminal fact. An execution with a
delivery attempt or saga must instead use
Self::complete_current_leg, which enters ArrivalPending, and then
Self::reconcile_information.
Sourcepub fn cancel(&mut self) -> Result<(), TransportError>
pub fn cancel(&mut self) -> Result<(), TransportError>
Cancels a non-terminal execution whose subject is not travelling.
No leg of the active itinerary may be departed (a leg in progress must
first arrive or fail) and an arrival-pending execution must reconcile
instead. Unstarted legs of the active itinerary become Cancelled; a
delivery saga enters CompensationPending. Bookings are not changed:
the caller closes them through CapacityBooking::transition.
pub fn completion_request( &self, ) -> Result<DeliveryCompletionRequest, TransportError>
pub fn reconcile_information( &mut self, outcome: ReconciliationOutcome, ) -> Result<(), TransportError>
Trait Implementations§
Source§impl Clone for TransportExecution
impl Clone for TransportExecution
Source§fn clone(&self) -> TransportExecution
fn clone(&self) -> TransportExecution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more