sbf_blake3/error.rs
1//! Convenience error module
2
3#[cfg(feature = "serde_support")]
4use serde::{Deserialize, Serialize};
5
6/// Custom error definitions
7#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
9pub enum Error {
10 /// Access index is larger than the maximum size allowed
11 IndexOutOfBounds,
12}
13
14impl std::fmt::Display for Error {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 write!(f, "{}", match &self {
17 Error::IndexOutOfBounds => "Index out of bounds",
18 })
19 }
20}
21
22impl std::error::Error for Error {}