pub enum GraphError {
Show 22 variants
NodeNotFound {
node: String,
graph_size: usize,
context: String,
},
EdgeNotFound {
src_node: String,
target: String,
context: String,
},
InvalidParameter {
param: String,
value: String,
expected: String,
context: String,
},
AlgorithmFailure {
algorithm: String,
reason: String,
iterations: usize,
tolerance: f64,
},
IOError {
path: String,
source: Error,
},
MemoryError {
requested: usize,
available: usize,
context: String,
},
ConvergenceError {
algorithm: String,
iterations: usize,
tolerance: f64,
threshold: f64,
},
GraphStructureError {
expected: String,
found: String,
context: String,
},
NoPath {
src_node: String,
target: String,
nodes: usize,
edges: usize,
},
CycleDetected {
start_node: String,
cycle_length: usize,
},
LinAlgError {
operation: String,
details: String,
},
SparseError {
details: String,
},
CoreError(CoreError),
SerializationError {
format: String,
details: String,
},
InvalidAttribute {
attribute: String,
target_type: String,
details: String,
},
Cancelled {
operation: String,
elapsed_time: f64,
},
ConcurrencyError {
operation: String,
details: String,
},
FormatError {
format: String,
version: String,
supported: String,
},
InvalidGraph(String),
AlgorithmError(String),
ComputationError(String),
Other(String),
}Expand description
Error type for graph processing operations
Provides detailed error information with context and suggestions for recovery. All errors include location information when possible.
Variants§
NodeNotFound
Node not found in the graph
Fields
EdgeNotFound
Edge not found in the graph
Fields
InvalidParameter
Invalid parameter provided to an operation
Fields
AlgorithmFailure
Algorithm failed to converge or complete
Fields
IOError
I/O operation failed
MemoryError
Memory allocation or usage error
Fields
ConvergenceError
Algorithm did not converge within specified limits
Fields
GraphStructureError
Graph structure is invalid for the operation
Fields
NoPath
No path exists between nodes
Fields
CycleDetected
Cycle detected when acyclic graph expected
LinAlgError
Linear algebra operation failed
SparseError
Sparse matrix operation failed
CoreError(CoreError)
Core module error
SerializationError
Serialization/deserialization failed
InvalidAttribute
Invalid graph attribute
Fields
Cancelled
Computation was cancelled or interrupted
ConcurrencyError
Thread safety or concurrency error
FormatError
Invalid graph format or version
InvalidGraph(String)
Invalid graph structure (legacy error for backward compatibility)
AlgorithmError(String)
Algorithm error (legacy error for backward compatibility)
ComputationError(String)
Computation error (legacy error for backward compatibility)
Other(String)
Generic error for backward compatibility
Implementations§
Source§impl GraphError
impl GraphError
Sourcepub fn node_not_found<T: Display>(node: T) -> Self
pub fn node_not_found<T: Display>(node: T) -> Self
Create a NodeNotFound error with minimal context
Sourcepub fn node_not_found_with_context<T: Display>(
node: T,
graph_size: usize,
context: &str,
) -> Self
pub fn node_not_found_with_context<T: Display>( node: T, graph_size: usize, context: &str, ) -> Self
Create a NodeNotFound error with full context
Sourcepub fn edge_not_found<S: Display, T: Display>(source: S, target: T) -> Self
pub fn edge_not_found<S: Display, T: Display>(source: S, target: T) -> Self
Create an EdgeNotFound error with minimal context
Sourcepub fn edge_not_found_with_context<S: Display, T: Display>(
source: S,
target: T,
context: &str,
) -> Self
pub fn edge_not_found_with_context<S: Display, T: Display>( source: S, target: T, context: &str, ) -> Self
Create an EdgeNotFound error with full context
Sourcepub fn invalid_parameter<P: Display, V: Display, E: Display>(
param: P,
value: V,
expected: E,
) -> Self
pub fn invalid_parameter<P: Display, V: Display, E: Display>( param: P, value: V, expected: E, ) -> Self
Create an InvalidParameter error
Sourcepub fn algorithm_failure<A: Display, R: Display>(
algorithm: A,
reason: R,
iterations: usize,
tolerance: f64,
) -> Self
pub fn algorithm_failure<A: Display, R: Display>( algorithm: A, reason: R, iterations: usize, tolerance: f64, ) -> Self
Create an AlgorithmFailure error
Sourcepub fn memory_error(requested: usize, available: usize, context: &str) -> Self
pub fn memory_error(requested: usize, available: usize, context: &str) -> Self
Create a MemoryError
Sourcepub fn convergence_error<A: Display>(
algorithm: A,
iterations: usize,
tolerance: f64,
threshold: f64,
) -> Self
pub fn convergence_error<A: Display>( algorithm: A, iterations: usize, tolerance: f64, threshold: f64, ) -> Self
Create a ConvergenceError
Sourcepub fn graph_structure_error<E: Display, F: Display>(
expected: E,
found: F,
context: &str,
) -> Self
pub fn graph_structure_error<E: Display, F: Display>( expected: E, found: F, context: &str, ) -> Self
Create a GraphStructureError
Sourcepub fn no_path<S: Display, T: Display>(
source: S,
target: T,
nodes: usize,
edges: usize,
) -> Self
pub fn no_path<S: Display, T: Display>( source: S, target: T, nodes: usize, edges: usize, ) -> Self
Create a NoPath error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Sourcepub fn recovery_suggestions(&self) -> Vec<String>
pub fn recovery_suggestions(&self) -> Vec<String>
Get suggestions for error recovery
Trait Implementations§
Source§impl Debug for GraphError
impl Debug for GraphError
Source§impl Display for GraphError
impl Display for GraphError
Source§impl Error for GraphError
impl Error for GraphError
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
Source§impl From<CoreError> for GraphError
impl From<CoreError> for GraphError
Auto Trait Implementations§
impl Freeze for GraphError
impl !RefUnwindSafe for GraphError
impl Send for GraphError
impl Sync for GraphError
impl Unpin for GraphError
impl !UnwindSafe for GraphError
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> 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