pub enum ValknutError {
Show 15 variants
Io {
message: String,
source: Error,
},
Config {
message: String,
field: Option<String>,
},
Parse {
language: String,
message: String,
file_path: Option<String>,
line: Option<usize>,
column: Option<usize>,
},
Math {
message: String,
context: Option<String>,
},
Graph {
message: String,
element: Option<String>,
},
Lsh {
message: String,
parameters: Option<String>,
},
Pipeline {
stage: String,
message: String,
processed_count: Option<usize>,
},
Cache {
message: String,
key: Option<String>,
},
Serialization {
message: String,
data_type: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Validation {
message: String,
field: Option<String>,
expected: Option<String>,
actual: Option<String>,
},
ResourceExhaustion {
message: String,
resource_type: String,
current_usage: Option<String>,
limit: Option<String>,
},
Concurrency {
message: String,
thread_id: Option<String>,
},
FeatureUnavailable {
feature: String,
reason: Option<String>,
},
Internal {
message: String,
context: Option<String>,
},
Unsupported {
message: String,
},
}Expand description
Comprehensive error type for all valknut operations.
Variants§
Io
I/O related errors (file operations, network, etc.)
Config
Configuration errors
Fields
Parse
Parsing and language processing errors
Fields
Math
Mathematical computation errors
Fields
Graph
Graph algorithm errors
Fields
Lsh
LSH and similarity detection errors
Fields
Pipeline
Analysis pipeline errors
Fields
Cache
Cache and storage errors
Serialization
Serialization/deserialization errors
Fields
Validation
Validation errors for input data
Fields
ResourceExhaustion
Resource exhaustion errors
Fields
Concurrency
Concurrency and threading errors
Feature not implemented or not available
Internal
Generic internal errors
Unsupported
Unsupported operation or feature
Implementations§
Source§impl ValknutError
Factory methods and context utilities for ValknutError.
impl ValknutError
Factory methods and context utilities for ValknutError.
Sourcepub fn io(message: impl Into<String>, source: Error) -> Self
pub fn io(message: impl Into<String>, source: Error) -> Self
Create a new I/O error with context
Sourcepub fn config_field(
message: impl Into<String>,
field: impl Into<String>,
) -> Self
pub fn config_field( message: impl Into<String>, field: impl Into<String>, ) -> Self
Create a new configuration error with field context
Sourcepub fn parse(language: impl Into<String>, message: impl Into<String>) -> Self
pub fn parse(language: impl Into<String>, message: impl Into<String>) -> Self
Create a new parse error
Sourcepub fn parse_with_location(
language: impl Into<String>,
message: impl Into<String>,
file_path: impl Into<String>,
line: Option<usize>,
column: Option<usize>,
) -> Self
pub fn parse_with_location( language: impl Into<String>, message: impl Into<String>, file_path: impl Into<String>, line: Option<usize>, column: Option<usize>, ) -> Self
Create a new parse error with file context
Sourcepub fn math_with_context(
message: impl Into<String>,
context: impl Into<String>,
) -> Self
pub fn math_with_context( message: impl Into<String>, context: impl Into<String>, ) -> Self
Create a new mathematical error with context
Sourcepub fn pipeline(stage: impl Into<String>, message: impl Into<String>) -> Self
pub fn pipeline(stage: impl Into<String>, message: impl Into<String>) -> Self
Create a new pipeline error
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Create a new validation error
Create a new feature unavailable error
Sourcepub fn unsupported(message: impl Into<String>) -> Self
pub fn unsupported(message: impl Into<String>) -> Self
Create a new unsupported error
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add context to an existing error
Source§impl ValknutError
Canonical error mapping adapters for ValknutError.
impl ValknutError
Canonical error mapping adapters for ValknutError.
These methods create closures suitable for use with Result::map_err.
Sourcepub fn map_io(message: impl Into<String>) -> impl FnOnce(Error) -> Self
pub fn map_io(message: impl Into<String>) -> impl FnOnce(Error) -> Self
Create error mapping adapter for I/O operations with custom message
Sourcepub fn map_serialization(
operation: impl Into<String>,
) -> impl FnOnce(Box<dyn Error + Send + Sync>) -> Self
pub fn map_serialization( operation: impl Into<String>, ) -> impl FnOnce(Box<dyn Error + Send + Sync>) -> Self
Create error mapping adapter for serialization operations
Sourcepub fn map_json_parse(context: impl Into<String>) -> impl FnOnce(Error) -> Self
pub fn map_json_parse(context: impl Into<String>) -> impl FnOnce(Error) -> Self
Create error mapping adapter for JSON parsing operations
Trait Implementations§
Source§impl Debug for ValknutError
impl Debug for ValknutError
Source§impl Display for ValknutError
impl Display for ValknutError
Source§impl Error for ValknutError
impl Error for ValknutError
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<Error> for ValknutError
Conversion from io::Error to ValknutError.
impl From<Error> for ValknutError
Conversion from io::Error to ValknutError.
Source§fn from(err: Error) -> Self
fn from(err: Error) -> Self
Converts an I/O error into a ValknutError::Io variant.
Source§impl From<Error> for ValknutError
Conversion from serde_json::Error to ValknutError.
impl From<Error> for ValknutError
Conversion from serde_json::Error to ValknutError.
Source§fn from(err: Error) -> Self
fn from(err: Error) -> Self
Converts a JSON error into a ValknutError::Serialization variant.
Source§impl From<Error> for ValknutError
Conversion from serde_yaml::Error to ValknutError.
impl From<Error> for ValknutError
Conversion from serde_yaml::Error to ValknutError.
Source§fn from(err: Error) -> Self
fn from(err: Error) -> Self
Converts a YAML error into a ValknutError::Serialization variant.
Source§impl From<ParseFloatError> for ValknutError
Conversion from ParseFloatError to ValknutError.
impl From<ParseFloatError> for ValknutError
Conversion from ParseFloatError to ValknutError.
Source§fn from(err: ParseFloatError) -> Self
fn from(err: ParseFloatError) -> Self
Converts a float parse error into a ValknutError::Validation variant.
Source§impl From<ParseIntError> for ValknutError
Conversion from ParseIntError to ValknutError.
impl From<ParseIntError> for ValknutError
Conversion from ParseIntError to ValknutError.
Source§fn from(err: ParseIntError) -> Self
fn from(err: ParseIntError) -> Self
Converts an integer parse error into a ValknutError::Validation variant.
Source§impl From<Utf8Error> for ValknutError
Conversion from Utf8Error to ValknutError.
impl From<Utf8Error> for ValknutError
Conversion from Utf8Error to ValknutError.
Source§fn from(err: Utf8Error) -> Self
fn from(err: Utf8Error) -> Self
Converts a UTF-8 error into a ValknutError::Parse variant.
Auto Trait Implementations§
impl Freeze for ValknutError
impl !RefUnwindSafe for ValknutError
impl Send for ValknutError
impl Sync for ValknutError
impl Unpin for ValknutError
impl !UnwindSafe for ValknutError
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<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§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.