Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
oiwn committed Jan 5, 2025
1 parent a0687f2 commit 5af6ba7
Show file tree
Hide file tree
Showing 13 changed files with 807 additions and 1,536 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Cargo.lock
.code
.DS_Store
*.redb
/tmp

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
Expand Down
25 changes: 25 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use thiserror::Error;

pub type Result<T> = std::result::Result<T, BloomError>;

#[derive(Error, Debug)]
pub enum BloomError {
#[error("Storage operation failed: {0}")]
StorageError(String),

#[error("Index out of bounds: {index} >= {capacity}")]
IndexOutOfBounds { index: usize, capacity: usize },

#[error("Invalid level: {level} >= {max_levels}")]
InvalidLevel { level: usize, max_levels: usize },

#[error("SystemTime error: {0}")]
SystemTimeError(#[from] std::time::SystemTimeError),

#[error("Serialization error: {0}")]
SerializationError(String),

#[cfg(feature = "redb")]
#[error("ReDB error: {0}")]
RedbError(#[from] redb::Error),
}
Loading

0 comments on commit 5af6ba7

Please sign in to comment.