#[non_exhaustive]pub enum SimError {
InvalidConfig {
field: &'static str,
reason: String,
},
EntityNotFound(EntityId),
StopNotFound(StopId),
GroupNotFound(GroupId),
InvalidState {
entity: EntityId,
reason: String,
},
LineNotFound(EntityId),
NoRoute {
origin: EntityId,
destination: EntityId,
origin_groups: Vec<GroupId>,
destination_groups: Vec<GroupId>,
},
AmbiguousRoute {
origin: EntityId,
destination: EntityId,
groups: Vec<GroupId>,
},
}Expand description
Errors that can occur during simulation setup or operation.
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.
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.
InvalidState
An operation was attempted on an entity in an invalid state.
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
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
Mutably borrows from an owned value. Read more