Squashed 'vendor/ruvector/' content from commit b64c2172
git-subtree-dir: vendor/ruvector git-subtree-split: b64c21726f2bb37286d9ee36a7869fef60cc6900
This commit is contained in:
46
examples/spiking-network/src/error.rs
Normal file
46
examples/spiking-network/src/error.rs
Normal file
@@ -0,0 +1,46 @@
|
||||
//! Error types for the spiking neural network library.
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
/// Result type alias for spiking network operations.
|
||||
pub type Result<T> = std::result::Result<T, SpikingError>;
|
||||
|
||||
/// Errors that can occur in spiking neural network operations.
|
||||
#[derive(Error, Debug)]
|
||||
pub enum SpikingError {
|
||||
/// Invalid neuron parameters
|
||||
#[error("Invalid neuron parameters: {0}")]
|
||||
InvalidParams(String),
|
||||
|
||||
/// Network topology error
|
||||
#[error("Network topology error: {0}")]
|
||||
TopologyError(String),
|
||||
|
||||
/// Spike encoding error
|
||||
#[error("Spike encoding error: {0}")]
|
||||
EncodingError(String),
|
||||
|
||||
/// Router error
|
||||
#[error("Router error: {0}")]
|
||||
RouterError(String),
|
||||
|
||||
/// Learning error
|
||||
#[error("Learning error: {0}")]
|
||||
LearningError(String),
|
||||
|
||||
/// Resource exhaustion
|
||||
#[error("Resource exhaustion: {0}")]
|
||||
ResourceExhausted(String),
|
||||
|
||||
/// Invalid operation
|
||||
#[error("Invalid operation: {0}")]
|
||||
InvalidOperation(String),
|
||||
|
||||
/// IO error wrapper
|
||||
#[error("IO error: {0}")]
|
||||
IoError(#[from] std::io::Error),
|
||||
|
||||
/// Serialization error
|
||||
#[error("Serialization error: {0}")]
|
||||
SerializationError(String),
|
||||
}
|
||||
Reference in New Issue
Block a user