Skip to main content

ProbeCachedDataSource

Struct ProbeCachedDataSource 

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

Small-window cache for repeated probe reads near the start of a source.

Implementations§

Source§

impl<'a> ProbeCachedDataSource<'a>

Source

pub fn new(inner: &'a dyn ByteSource) -> Self

Wrap a source with a probe-oriented cache.

Trait Implementations§

Source§

impl ByteSource for ProbeCachedDataSource<'_>

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>

Read bytes starting at offset into buf.
Source§

fn size(&self) -> Result<u64>

Return the total size of this source in bytes.
Source§

fn capabilities(&self) -> ByteSourceCapabilities

Describe the backend’s read behavior.
Source§

fn telemetry_name(&self) -> &'static str

Return a stable label for tracing and diagnostics.
Source§

fn read_exact_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Read exactly buf.len() bytes from offset.
Source§

fn read_bytes_at(&self, offset: u64, len: usize) -> Result<Vec<u8>>

Read len bytes from offset into a new buffer.
Source§

fn read_all(&self) -> Result<Vec<u8>>

Materialize the full source into memory.

Auto Trait Implementations§

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.