pub enum NetworkError {
NodeIndexOutOfBounds(usize),
InvalidEdge(usize, usize),
DimensionMismatch {
expected: usize,
got: usize,
},
DisconnectedNetwork,
ComputationError(String),
InvalidParameter {
parameter: String,
value: String,
constraint: String,
},
EmptyNetwork,
ConvergenceFailure {
iterations: usize,
},
InsufficientData {
reason: String,
},
}Expand description
Error types for network analysis operations
Variants§
NodeIndexOutOfBounds(usize)
Node index is out of bounds
InvalidEdge(usize, usize)
Invalid edge specification
DimensionMismatch
Matrix dimension mismatch
DisconnectedNetwork
Network is disconnected when connected network required
ComputationError(String)
Computation failed with detailed message
InvalidParameter
Invalid parameter value
EmptyNetwork
Empty network when non-empty required
ConvergenceFailure
Convergence failure in iterative algorithm
InsufficientData
Insufficient data for analysis
Implementations§
Source§impl NetworkError
impl NetworkError
Sourcepub fn computation<T: Display>(msg: T) -> Self
pub fn computation<T: Display>(msg: T) -> Self
Create a computation error with formatted message
Sourcepub fn invalid_param(param: &str, value: impl Display, constraint: &str) -> Self
pub fn invalid_param(param: &str, value: impl Display, constraint: &str) -> Self
Create an invalid parameter error
Sourcepub fn insufficient_data(reason: &str) -> Self
pub fn insufficient_data(reason: &str) -> Self
Create an insufficient data error
Trait Implementations§
Source§impl Clone for NetworkError
impl Clone for NetworkError
Source§fn clone(&self) -> NetworkError
fn clone(&self) -> NetworkError
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 NetworkError
impl Debug for NetworkError
Source§impl Display for NetworkError
impl Display for NetworkError
Source§impl Error for NetworkError
impl Error for NetworkError
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 NetworkError
impl PartialEq for NetworkError
impl StructuralPartialEq for NetworkError
Auto Trait Implementations§
impl Freeze for NetworkError
impl RefUnwindSafe for NetworkError
impl Send for NetworkError
impl Sync for NetworkError
impl Unpin for NetworkError
impl UnwindSafe for NetworkError
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.