pub enum TspInstanceError {
ParseError(String),
MatrixDimensionMismatch {
expected: usize,
got_rows: usize,
},
MatrixRowMismatch {
row: usize,
expected: usize,
got: usize,
},
TriangleInequalityViolation {
i: usize,
j: usize,
k: usize,
},
AsymmetricMatrix {
i: usize,
j: usize,
forward: u32,
backward: u32,
},
InvalidCityId {
id: usize,
max: usize,
},
IoError(String),
}Expand description
Error types for TSP instance parsing/validation.
Variants§
ParseError(String)
YAML parsing failed.
MatrixDimensionMismatch
Matrix dimensions don’t match city count.
MatrixRowMismatch
Matrix row has wrong number of columns.
TriangleInequalityViolation
Triangle inequality violated.
AsymmetricMatrix
Matrix is not symmetric.
InvalidCityId
Invalid city ID.
IoError(String)
IO error.
Trait Implementations§
Source§impl Clone for TspInstanceError
impl Clone for TspInstanceError
Source§fn clone(&self) -> TspInstanceError
fn clone(&self) -> TspInstanceError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TspInstanceError
impl Debug for TspInstanceError
Source§impl Display for TspInstanceError
impl Display for TspInstanceError
Source§impl Error for TspInstanceError
impl Error for TspInstanceError
1.30.0 · 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()
Source§impl PartialEq for TspInstanceError
impl PartialEq for TspInstanceError
impl Eq for TspInstanceError
impl StructuralPartialEq for TspInstanceError
Auto Trait Implementations§
impl Freeze for TspInstanceError
impl RefUnwindSafe for TspInstanceError
impl Send for TspInstanceError
impl Sync for TspInstanceError
impl Unpin for TspInstanceError
impl UnsafeUnpin for TspInstanceError
impl UnwindSafe for TspInstanceError
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
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
Compare self to
key and return true if they are equal.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP