#[non_exhaustive]pub enum Injection {
Cancel {
trip_id: String,
},
CancelStop {
trip_id: String,
stop_id: String,
},
Delay {
trip_id: String,
minutes: i64,
},
NoRealtime,
Respond {
endpoint: Endpoint,
status: u16,
body: String,
},
RateLimited {
retry_after_seconds: u64,
},
Slow(Duration),
Malformed,
}Expand description
A change to the answers of the sim. Injections stay until
Sim::clear.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Cancel
Cancels a trip: its legs, their stops and its departures.
CancelStop
Cancels one stop of a trip, as for a skipped stop.
Delay
Delays a trip: shifts its realtime times and marks it as realtime.
NoRealtime
Removes the realtime data: the times are the schedule.
Respond
Answers an endpoint with this status and body.
RateLimited
Answers every request with 429 and Retry-After.
Slow(Duration)
Waits this long before answering.
Malformed
Answers every request with a body that is not JSON.
Trait Implementations§
impl StructuralPartialEq for Injection
Auto Trait Implementations§
impl Forget for Injection
impl Freeze for Injection
impl Move for Injection
impl RefUnwindSafe for Injection
impl Send for Injection
impl Sync for Injection
impl Unpin for Injection
impl UnsafeUnpin for Injection
impl UnwindSafe for Injection
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