Skip to main content

WindowedReader

Struct WindowedReader 

Source
pub struct WindowedReader<G, M: JoinMode, const BODY_SIZE: usize = DEFAULT_BODY_SIZE>
where G: ChunkGet<BODY_SIZE>,
{ /* private fields */ }
Expand description

Seek-and-play reader: forward in-order delivery over a window that slides with the read cursor, bounded to window in-flight plus buffered leaves.

Retains the joiner’s reusable state (getter, pre-expanded frontier, tree params) so each stream rebuilds a fresh window-bounded walk from [position, size) without re-expanding the frontier. seek only repositions; it never re-fetches intermediates.

Implementations§

Source§

impl<G, M, const BODY_SIZE: usize> WindowedReader<G, M, BODY_SIZE>
where G: ChunkGet<BODY_SIZE> + 'static, M: JoinMode + MaybeSend + Sync,

Source

pub fn stream(&mut self) -> impl Stream<Item = Result<Bytes>> + '_

In-order leaf bodies from the current position to EOF. Each item is one contiguous run; reassembly is pure concatenation. Peak memory is window leaf bodies: the window slides with the emit cursor, so only leaves within window spans ahead of it are ever fetched or held.

Source

pub fn seek(&mut self, pos: SeekFrom) -> Result<u64>

Reposition: drop the window and restart the walk from pos. Cheap; reuses the frontier, no intermediate re-fetch.

Source

pub const fn position(&self) -> u64

Current read position.

Source

pub const fn size(&self) -> u64

Total file size.

Source§

impl<G, M, const BODY_SIZE: usize> WindowedReader<G, M, BODY_SIZE>
where G: ChunkGet<BODY_SIZE> + 'static, M: JoinMode + Send + Sync + 'static,

Source

pub fn into_reader(self) -> WindowedJoinerReader<G, M, BODY_SIZE>

Wrap as a tokio AsyncRead + AsyncSeek reader. Native-only.

Trait Implementations§

Source§

impl<G, M, const BODY_SIZE: usize> Debug for WindowedReader<G, M, BODY_SIZE>
where G: ChunkGet<BODY_SIZE>, M: JoinMode,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<G, M, const BODY_SIZE: usize> Freeze for WindowedReader<G, M, BODY_SIZE>

§

impl<G, M, const BODY_SIZE: usize> RefUnwindSafe for WindowedReader<G, M, BODY_SIZE>

§

impl<G, M, const BODY_SIZE: usize> Send for WindowedReader<G, M, BODY_SIZE>

§

impl<G, M, const BODY_SIZE: usize> Sync for WindowedReader<G, M, BODY_SIZE>

§

impl<G, M, const BODY_SIZE: usize> Unpin for WindowedReader<G, M, BODY_SIZE>
where <M as JoinMode>::JoinerContext: Unpin,

§

impl<G, M, const BODY_SIZE: usize> UnsafeUnpin for WindowedReader<G, M, BODY_SIZE>

§

impl<G, M, const BODY_SIZE: usize> UnwindSafe for WindowedReader<G, M, BODY_SIZE>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more