rusty_structures/
lib.rs

1pub mod bloom_filter;
2pub mod priority_queue;
3
4pub type RustyResult<T> = Result<T, Box<dyn std::error::Error>>;
5
6#[derive(Debug)]
7pub struct RustyError {
8    reason: String
9}
10
11impl RustyError {
12    pub fn new(reason: String) -> Self {
13        Self { reason }
14    }
15}
16
17impl std::error::Error for RustyError {}
18
19impl std::fmt::Display for RustyError {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21        write!(f, "Reason: {}", self.reason)
22    }
23}