MemDriver

Struct MemDriver 

Source
pub struct MemDriver<T: Processable> { /* private fields */ }
Expand description

The core driver between the block stream and MST walker

In the future, PDSs will export CARs in a stream-friendly order that will enable processing them with tiny memory overhead. But that future is not here yet.

CARs are almost always in a stream-unfriendly order, so I’m reverting the optimistic stream features: we load all block first, then walk the MST.

This makes things much simpler: we only need to worry about spilling to disk in one place, and we always have a reasonable expecatation about how much work the init function will do. We can drop the CAR reader before walking, so the sync/async boundaries become a little easier to work around.

Implementations§

Source§

impl<T: Processable> MemDriver<T>

Source

pub async fn next_chunk( &mut self, n: usize, ) -> Result<Option<BlockChunk<T>>, DriveError>

Step through the record outputs, in rkey order

Trait Implementations§

Source§

impl<T: Debug + Processable> Debug for MemDriver<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for MemDriver<T>

§

impl<T> RefUnwindSafe for MemDriver<T>
where T: RefUnwindSafe,

§

impl<T> Send for MemDriver<T>
where T: Send,

§

impl<T> Sync for MemDriver<T>
where T: Sync,

§

impl<T> Unpin for MemDriver<T>
where T: Unpin,

§

impl<T> UnwindSafe for MemDriver<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.