Fast and robust atproto CAR file processing in rust
14
fork

Configure Feed

Select the types of activity you want to include in your feed.

redundant type alias

phil 7317a392 a17eb29a

+4 -7
+2 -5
src/drive.rs
··· 55 55 Processed(Result<T, E>), 56 56 } 57 57 58 - // TODO: generic error not box dyn nonsense. 59 - pub type ProcRes<T, E> = Result<T, E>; 60 - 61 58 pub struct Vehicle<SE, S, T, P, PE> 62 59 where 63 60 S: Stream<Item = CarBlock<SE>>, 64 - P: Fn(&[u8]) -> ProcRes<T, PE>, 61 + P: Fn(&[u8]) -> Result<T, PE>, 65 62 PE: Error, 66 63 { 67 64 block_stream: S, ··· 75 72 where 76 73 SE: Error + 'static, 77 74 S: Stream<Item = CarBlock<SE>> + Unpin, 78 - P: Fn(&[u8]) -> ProcRes<T, PE>, 75 + P: Fn(&[u8]) -> Result<T, PE>, 79 76 PE: Error, 80 77 { 81 78 pub async fn init(
+2 -2
src/walk.rs
··· 1 1 //! Depth-first MST traversal 2 2 3 - use crate::drive::{MaybeProcessedBlock, ProcRes}; 3 + use crate::drive::MaybeProcessedBlock; 4 4 use crate::mst::Node; 5 5 use ipld_core::cid::Cid; 6 6 use std::collections::HashMap; ··· 85 85 pub fn walk<T: Clone, E: Error>( 86 86 &mut self, 87 87 blocks: &mut HashMap<Cid, MaybeProcessedBlock<T, E>>, 88 - process: impl Fn(&[u8]) -> ProcRes<T, E>, 88 + process: impl Fn(&[u8]) -> Result<T, E>, 89 89 ) -> Result<Step<T>, Trip<E>> { 90 90 loop { 91 91 let Some(mut need) = self.stack.last() else {