GraphError

Enum GraphError 

Source
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

§node: String

The node that was not found

§graph_size: usize

Size of the graph for context

§context: String

Additional context about the operation

§

EdgeNotFound

Edge not found in the graph

Fields

§src_node: String

Source node of the edge

§target: String

Target node of the edge

§context: String

Additional context about the operation

§

InvalidParameter

Invalid parameter provided to an operation

Fields

§param: String

Parameter name

§value: String

Provided value

§expected: String

Expected value or range

§context: String

Additional context

§

AlgorithmFailure

Algorithm failed to converge or complete

Fields

§algorithm: String

Name of the algorithm

§reason: String

Reason for failure

§iterations: usize

Number of iterations completed

§tolerance: f64

Tolerance used

§

IOError

I/O operation failed

Fields

§path: String

File path that caused the error

§source: Error

Underlying I/O error

§

MemoryError

Memory allocation or usage error

Fields

§requested: usize

Requested memory in bytes

§available: usize

Available memory in bytes

§context: String

Additional context

§

ConvergenceError

Algorithm did not converge within specified limits

Fields

§algorithm: String

Algorithm name

§iterations: usize

Iterations completed

§tolerance: f64

Final tolerance achieved

§threshold: f64

Required threshold

§

GraphStructureError

Graph structure is invalid for the operation

Fields

§expected: String

Expected graph property

§found: String

Actual graph property

§context: String

Additional context

§

NoPath

No path exists between nodes

Fields

§src_node: String

Source node

§target: String

Target node

§nodes: usize

Number of nodes in graph

§edges: usize

Number of edges in graph

§

CycleDetected

Cycle detected when acyclic graph expected

Fields

§start_node: String

Node where cycle starts

§cycle_length: usize

Length of the detected cycle

§

LinAlgError

Linear algebra operation failed

Fields

§operation: String

Operation that failed

§details: String

Error details

§

SparseError

Sparse matrix operation failed

Fields

§details: String

Error details

§

CoreError(CoreError)

Core module error

§

SerializationError

Serialization/deserialization failed

Fields

§format: String

Data format (JSON, bincode, etc.)

§details: String

Error details

§

InvalidAttribute

Invalid graph attribute

Fields

§attribute: String

Attribute name

§target_type: String

Target type (node, edge, graph)

§details: String

Error details

§

Cancelled

Computation was cancelled or interrupted

Fields

§operation: String

Operation name

§elapsed_time: f64

Time elapsed before cancellation

§

ConcurrencyError

Thread safety or concurrency error

Fields

§operation: String

Operation name

§details: String

Error details

§

FormatError

Invalid graph format or version

Fields

§format: String

Format name

§version: String

Version found

§supported: String

Supported versions

§

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

Source

pub fn node_not_found<T: Display>(node: T) -> Self

Create a NodeNotFound error with minimal context

Source

pub fn node_not_found_with_context<T: Display>( node: T, graph_size: usize, context: &str, ) -> Self

Create a NodeNotFound error with full context

Source

pub fn edge_not_found<S: Display, T: Display>(source: S, target: T) -> Self

Create an EdgeNotFound error with minimal context

Source

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

Source

pub fn invalid_parameter<P: Display, V: Display, E: Display>( param: P, value: V, expected: E, ) -> Self

Create an InvalidParameter error

Source

pub fn algorithm_failure<A: Display, R: Display>( algorithm: A, reason: R, iterations: usize, tolerance: f64, ) -> Self

Create an AlgorithmFailure error

Source

pub fn memory_error(requested: usize, available: usize, context: &str) -> Self

Create a MemoryError

Source

pub fn convergence_error<A: Display>( algorithm: A, iterations: usize, tolerance: f64, threshold: f64, ) -> Self

Create a ConvergenceError

Source

pub fn graph_structure_error<E: Display, F: Display>( expected: E, found: F, context: &str, ) -> Self

Create a GraphStructureError

Source

pub fn no_path<S: Display, T: Display>( source: S, target: T, nodes: usize, edges: usize, ) -> Self

Create a NoPath error

Source

pub fn is_recoverable(&self) -> bool

Check if this error is recoverable

Source

pub fn recovery_suggestions(&self) -> Vec<String>

Get suggestions for error recovery

Source

pub fn category(&self) -> &'static str

Get the error category for metrics and logging

Trait Implementations§

Source§

impl Debug for GraphError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for GraphError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for GraphError

Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CoreError> for GraphError

Source§

fn from(source: CoreError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for GraphError

Convert std::io::Error to GraphError with path context

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V