Skip to main content

CacheEntryReader

Struct CacheEntryReader 

Source
pub struct CacheEntryReader<'a> { /* private fields */ }
Expand description

Reads a cache entry body, tracking an offset into the input and exposing the entry’s type_version so implementors can branch for backward compat.

All reads are zero-copy: returned Bytes and the buffers behind decoded RecordBatches borrow from the input allocation.

Implementations§

Source§

impl<'a> CacheEntryReader<'a>

Source

pub fn new(data: &'a Bytes, offset: usize, version: u32) -> Self

Create a reader over data, starting at body byte offset, for an entry written at version.

Source

pub fn version(&self) -> u32

The type_version from the envelope. Branch on this for backward compat.

Source

pub fn read_u8(&mut self) -> Result<u8>

Read a single discriminant byte written by CacheEntryWriter::write_u8.

Source

pub fn read_header<P: Message + Default>(&mut self) -> Result<P>

Read a protobuf header written by CacheEntryWriter::write_header.

Source

pub fn read_ipc(&mut self) -> Result<RecordBatch>

Read one RecordBatch from a 64-byte-aligned IPC section.

Source

pub fn read_ipc_batches(&mut self) -> Result<Vec<RecordBatch>>

Read all RecordBatches from a 64-byte-aligned multi-batch IPC section written by CacheEntryWriter::write_ipc_batches.

Source

pub fn read_raw(&mut self) -> Result<Bytes>

Read a raw blob written by CacheEntryWriter::write_raw, zero-copy.

Source

pub fn body(&self) -> Bytes

The not-yet-consumed body bytes as a zero-copy slice.

For a payload that carries its own framing and is parsed with the codec’s own cursor — the read counterpart of CacheEntryWriter::raw_writer. For structured bodies prefer read_header / read_ipc / read_raw.

Auto Trait Implementations§

§

impl<'a> Freeze for CacheEntryReader<'a>

§

impl<'a> RefUnwindSafe for CacheEntryReader<'a>

§

impl<'a> Send for CacheEntryReader<'a>

§

impl<'a> Sync for CacheEntryReader<'a>

§

impl<'a> Unpin for CacheEntryReader<'a>

§

impl<'a> UnsafeUnpin for CacheEntryReader<'a>

§

impl<'a> UnwindSafe for CacheEntryReader<'a>

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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> 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, 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