#[non_exhaustive]pub enum SimError {
Show 19 variants
InvalidConfig {
field: &'static str,
reason: String,
},
EntityNotFound(EntityId),
StopNotFound(StopId),
GroupNotFound(GroupId),
RouteOriginMismatch {
expected_origin: EntityId,
route_origin: EntityId,
},
LineDoesNotServeStop {
line_or_car: EntityId,
stop: EntityId,
},
HallCallNotFound {
stop: EntityId,
direction: CallDirection,
},
WrongRiderPhase {
rider: EntityId,
expected: RiderPhaseKind,
actual: RiderPhaseKind,
},
RiderHasNoStop(EntityId),
EmptyRoute,
NotAnElevator(EntityId),
ElevatorDisabled(EntityId),
WrongServiceMode {
entity: EntityId,
expected: ServiceMode,
actual: ServiceMode,
},
NotAStop(EntityId),
LineNotFound(EntityId),
NoRoute {
origin: EntityId,
destination: EntityId,
origin_groups: Vec<GroupId>,
destination_groups: Vec<GroupId>,
},
AmbiguousRoute {
origin: EntityId,
destination: EntityId,
groups: Vec<GroupId>,
},
SnapshotVersion {
saved: String,
current: String,
},
SnapshotFormat(String),
}Expand description
Errors that can occur during simulation setup or operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidConfig
Configuration is invalid.
Fields
EntityNotFound(EntityId)
A referenced entity does not exist.
StopNotFound(StopId)
A referenced stop ID does not exist in the config.
GroupNotFound(GroupId)
A referenced group does not exist.
RouteOriginMismatch
The route’s origin does not match the expected origin.
Fields
LineDoesNotServeStop
An elevator’s line does not serve the target stop.
Fields
HallCallNotFound
No hall call exists at the given stop and direction.
WrongRiderPhase
A rider is in the wrong lifecycle phase for the attempted operation.
Fields
expected: RiderPhaseKindThe phase required by the operation.
actual: RiderPhaseKindThe rider’s current phase.
RiderHasNoStop(EntityId)
A rider has no current stop when one is required.
EmptyRoute
A route has no legs.
NotAnElevator(EntityId)
The entity is not an elevator.
ElevatorDisabled(EntityId)
The elevator is disabled.
WrongServiceMode
The elevator is in an incompatible service mode.
Fields
expected: ServiceModeThe service mode required by the operation.
actual: ServiceModeThe elevator’s current service mode.
NotAStop(EntityId)
The entity is not a stop.
LineNotFound(EntityId)
A line entity was not found.
NoRoute
No route exists between origin and destination across any group.
Fields
AmbiguousRoute
Multiple groups serve both origin and destination — caller must specify.
Fields
SnapshotVersion
Snapshot bytes were produced by a different crate version.
Fields
SnapshotFormat(String)
Snapshot bytes are malformed or not a snapshot at all.
Trait Implementations§
Source§impl Error for SimError
impl Error for SimError
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()
impl Eq for SimError
impl StructuralPartialEq for SimError
Auto Trait Implementations§
impl Freeze for SimError
impl RefUnwindSafe for SimError
impl Send for SimError
impl Sync for SimError
impl Unpin for SimError
impl UnsafeUnpin for SimError
impl UnwindSafe for SimError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.