#[non_exhaustive]pub enum TripCommand {
Show 14 variants
Open,
OpenFor {
traveler: TripTraveler,
},
SetName {
value: String,
},
SetTravelDate {
value: NaiveDate,
},
AddExtra {
extra: NewExtra,
},
AssignPayer {
extra_id: Uuid,
payer: Payer,
},
ChangeExtra {
extra_id: Uuid,
description: Option<String>,
quantity: Option<u32>,
unit_price_cents: Option<i64>,
},
ChangeTraveler {
traveler: TripTraveler,
},
ProtectLeg {
leg: u32,
},
Requote {
leg: u32,
flight: String,
departs: String,
fare_difference_cents: i64,
},
RequestRebooking {
leg: u32,
},
Rebook,
Withdraw,
RecordAirlineOutcome {
status: ExternalStatus,
ticket_number: Option<String>,
reason_code: Option<String>,
},
}Expand description
One typed trip command.
Every command names what it does: policy, validation and receipts all key off
the variant. Requote and RecordAirlineOutcome come from the airline, never
from the interpreter, so no operation compiles to them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Open
Bring the case into existence, on the sample booking.
OpenFor
Bring the case into existence, for its traveler.
Fields
traveler: TripTravelerThe traveler.
SetName
Name the trip.
SetTravelDate
Set the day the traveler would rather fly.
AddExtra
Add an extra.
AssignPayer
Say who pays for an extra.
ChangeExtra
Change an extra already on the case; what is not given stays as it was.
Fields
ChangeTraveler
Put another traveler on the case. Carries the server-authored label as well as the identifier so cards never have to read it again.
Fields
traveler: TripTravelerThe new traveler.
ProtectLeg
Keep a leg as it is: nothing may change it from now on.
Requote
The airline quoted, or quoted again, the rebooking of a leg.
Fields
RequestRebooking
Move to the rebooking confirmation phase for a leg.
Rebook
Send the rebooking to the airline.
Withdraw
Withdraw the case before a rebooking is sent.
RecordAirlineOutcome
Record what the airline said about the rebooking.
Trait Implementations§
Source§impl Clone for TripCommand
impl Clone for TripCommand
Source§impl Debug for TripCommand
impl Debug for TripCommand
Source§impl<'de> Deserialize<'de> for TripCommand
impl<'de> Deserialize<'de> for TripCommand
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>,
impl Eq for TripCommand
Source§impl PartialEq for TripCommand
impl PartialEq for TripCommand
Source§impl Serialize for TripCommand
impl Serialize for TripCommand
impl StructuralPartialEq for TripCommand
Auto Trait Implementations§
impl Freeze for TripCommand
impl RefUnwindSafe for TripCommand
impl Send for TripCommand
impl Sync for TripCommand
impl Unpin for TripCommand
impl UnsafeUnpin for TripCommand
impl UnwindSafe for TripCommand
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.