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, OxiCode, 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>(node: T) -> GraphError
where T: Display,

Create a NodeNotFound error with minimal context

Source

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

Create a NodeNotFound error with full context

Source

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

Create an EdgeNotFound error with minimal context

Source

pub fn edge_not_found_with_context<S, T>( source: S, target: T, context: &str, ) -> GraphError
where S: Display, T: Display,

Create an EdgeNotFound error with full context

Source

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

Create an InvalidParameter error

Source

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

Create an AlgorithmFailure error

Source

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

Create a MemoryError

Source

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

Create a ConvergenceError

Source

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

Create a GraphStructureError

Source

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

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<(), Error>

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

impl Display for GraphError

Source§

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

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) -> GraphError

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) -> GraphError

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more