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>(node: T) -> GraphErrorwhere
T: Display,
pub fn node_not_found<T>(node: T) -> GraphErrorwhere
T: Display,
Create a NodeNotFound error with minimal context
Sourcepub fn node_not_found_with_context<T>(
node: T,
graph_size: usize,
context: &str,
) -> GraphErrorwhere
T: Display,
pub fn node_not_found_with_context<T>(
node: T,
graph_size: usize,
context: &str,
) -> GraphErrorwhere
T: Display,
Create a NodeNotFound error with full context
Sourcepub fn edge_not_found<S, T>(source: S, target: T) -> GraphError
pub fn edge_not_found<S, T>(source: S, target: T) -> GraphError
Create an EdgeNotFound error with minimal context
Sourcepub fn edge_not_found_with_context<S, T>(
source: S,
target: T,
context: &str,
) -> GraphError
pub fn edge_not_found_with_context<S, T>( source: S, target: T, context: &str, ) -> GraphError
Create an EdgeNotFound error with full context
Sourcepub fn invalid_parameter<P, V, E>(param: P, value: V, expected: E) -> GraphError
pub fn invalid_parameter<P, V, E>(param: P, value: V, expected: E) -> GraphError
Create an InvalidParameter error
Sourcepub fn algorithm_failure<A, R>(
algorithm: A,
reason: R,
iterations: usize,
tolerance: f64,
) -> GraphError
pub fn algorithm_failure<A, R>( algorithm: A, reason: R, iterations: usize, tolerance: f64, ) -> GraphError
Create an AlgorithmFailure error
Sourcepub fn memory_error(
requested: usize,
available: usize,
context: &str,
) -> GraphError
pub fn memory_error( requested: usize, available: usize, context: &str, ) -> GraphError
Create a MemoryError
Sourcepub fn convergence_error<A>(
algorithm: A,
iterations: usize,
tolerance: f64,
threshold: f64,
) -> GraphErrorwhere
A: Display,
pub fn convergence_error<A>(
algorithm: A,
iterations: usize,
tolerance: f64,
threshold: f64,
) -> GraphErrorwhere
A: Display,
Create a ConvergenceError
Sourcepub fn graph_structure_error<E, F>(
expected: E,
found: F,
context: &str,
) -> GraphError
pub fn graph_structure_error<E, F>( expected: E, found: F, context: &str, ) -> GraphError
Create a GraphStructureError
Sourcepub fn no_path<S, T>(
source: S,
target: T,
nodes: usize,
edges: usize,
) -> GraphError
pub fn no_path<S, T>( source: S, target: T, nodes: usize, edges: usize, ) -> GraphError
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
Source§fn from(source: CoreError) -> GraphError
fn from(source: CoreError) -> GraphError
Source§impl From<Error> for GraphError
Convert std::io::Error to GraphError with path context
impl From<Error> for GraphError
Convert std::io::Error to GraphError with path context
Source§fn from(err: Error) -> GraphError
fn from(err: Error) -> 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.