pub struct Vehicle<SE, S, T, P, PE>{ /* private fields */ }
Expand description
The core driver between the block stream and MST walker
Implementations§
Source§impl<SE, S, T: Clone, P, PE> Vehicle<SE, S, T, P, PE>
impl<SE, S, T: Clone, P, PE> Vehicle<SE, S, T, P, PE>
Sourcepub async fn init(
root: Cid,
block_stream: S,
process: P,
) -> Result<(Commit, Self), DriveError<PE>>
pub async fn init( root: Cid, block_stream: S, process: P, ) -> Result<(Commit, Self), DriveError<PE>>
Set up the stream
This will eagerly consume blocks until the Commit
object is found.
Usually the it’s the first block, but there is no guarantee.
§Parameters
root
: CID of the commit object that is the root of the MST
block_stream
: Input stream of raw CAR blocks
process
: record-transforming callback:
For tasks where records can be quickly processed into a smaller useful representation, you can do that eagerly as blocks come in by passing the processor as a callback here. This can reduce overall memory usage.
Sourcepub async fn next_record(
&mut self,
) -> Result<Option<(String, T)>, DriveError<PE>>
pub async fn next_record( &mut self, ) -> Result<Option<(String, T)>, DriveError<PE>>
Manually step through the record outputs
Auto Trait Implementations§
impl<SE, S, T, P, PE> Freeze for Vehicle<SE, S, T, P, PE>
impl<SE, S, T, P, PE> RefUnwindSafe for Vehicle<SE, S, T, P, PE>
impl<SE, S, T, P, PE> Send for Vehicle<SE, S, T, P, PE>
impl<SE, S, T, P, PE> Sync for Vehicle<SE, S, T, P, PE>
impl<SE, S, T, P, PE> Unpin for Vehicle<SE, S, T, P, PE>
impl<SE, S, T, P, PE> UnwindSafe for Vehicle<SE, S, T, P, PE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more