#[non_exhaustive]pub enum TimingError {
NoBoardingStop {
leg: usize,
route: RouteIdx,
from_stop: StopIdx,
},
NoCatchableTrip {
leg: usize,
route: RouteIdx,
board_pos: u32,
at: SecondOfDay,
},
UnreachableAlight {
leg: usize,
route: RouteIdx,
board_pos: u32,
alight: StopIdx,
},
}Expand description
Failure modes for Journey::with_timing.
Each variant carries the leg index where reconstruction stopped (zero-based)
and enough context to identify what went wrong. For a Journey produced by
the same timetable the algorithm ran against, the only variant a caller
realistically hits is TimingError::NoBoardingStop – and only when a
transfer needs a walk chain longer than one direct footpath hop. The other
two variants surface programmer errors (a Journey matched against a
different timetable, a custom adapter violating the no-overtaking contract).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoBoardingStop
No stop in the plan-reconstruction frontier (the previous leg’s
alight stop or any of its one-hop footpath neighbours) is served
by the route this leg wants to board. Multi-hop walk chains are
not reconstructed – if the original journey actually walked
through more than one intermediate stop, that walk can’t be
recovered from Journey.plan alone today.
Fields
NoCatchableTrip
No trip on the boarded route departs at or after the rider’s
available time. For a Journey produced by the same timetable
this should not happen – surface as a programmer-error escape
hatch.
Fields
at: SecondOfDayThe time at which the rider was ready to board.
UnreachableAlight
The boarded route’s stop sequence (from the boarding position
onwards) does not include the claimed alighting stop. For a
Journey produced by the same timetable this should not
happen – surface as a programmer-error escape hatch.
Trait Implementations§
Source§impl Clone for TimingError
impl Clone for TimingError
Source§fn clone(&self) -> TimingError
fn clone(&self) -> TimingError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TimingError
impl Debug for TimingError
Source§impl Display for TimingError
impl Display for TimingError
Source§impl Error for TimingError
impl Error for TimingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for TimingError
impl RefUnwindSafe for TimingError
impl Send for TimingError
impl Sync for TimingError
impl Unpin for TimingError
impl UnsafeUnpin for TimingError
impl UnwindSafe for TimingError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more