lightweight com.atproto.sync.listReposByCollection
at main 29 lines 748 B view raw
1use thiserror::Error; 2 3#[derive(Debug, Error)] 4pub enum StorageError { 5 #[error("fjall: {0}")] 6 Fjall(#[from] fjall::Error), 7 #[error("corruption at key {key}: {reason}")] 8 Corrupt { key: String, reason: &'static str }, 9} 10 11impl PartialEq for StorageError { 12 fn eq(&self, other: &StorageError) -> bool { 13 match (self, other) { 14 ( 15 StorageError::Corrupt { 16 key: ka, 17 reason: ra, 18 }, 19 StorageError::Corrupt { 20 key: kb, 21 reason: rb, 22 }, 23 ) => ka == kb && ra == rb, 24 _ => unimplemented!(), 25 } 26 } 27} 28 29pub type StorageResult<T> = Result<T, StorageError>;