pub struct DecodeSideSource { /* private fields */ }Expand description
A Source whose read failures are marked as decode-side.
Wrapped around a codec’s decoder output by probe.rs — at both of the two
places a decoder is built, so the marking is a property of “a decoder ran”,
not of which resolution route was taken.
as_seek FORWARDS rather than wrapping, and that is a deliberate gap with
a measured floor under it: a codec’s decoder returns StreamOnly, whose
as_seek is None, so no seek reaches the forwarded path from any
registered codec today. Wrapping it would need a second adapter around a
borrowed &mut dyn SeekRead, which is not expressible without boxing per
call. A codec that one day exposes a real seek table (seekable zstd, an xz
block index — the case Source::as_seek exists for) must revisit this.
Implementations§
Source§impl DecodeSideSource
impl DecodeSideSource
Sourcepub fn wrap(inner: Box<dyn Source>) -> Box<dyn Source>
pub fn wrap(inner: Box<dyn Source>) -> Box<dyn Source>
Wraps inner, which must be a codec decoder’s output.
Returns a Box<dyn Source> rather than Self because every caller
immediately needs the trait object, and handing back the concrete type
would invite a caller to keep it and lose the marking by passing the
inner source on instead.
Trait Implementations§
Source§impl Read for DecodeSideSource
impl Read for DecodeSideSource
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · Source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read, except that it reads into a slice of buffers. Read moreSource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf. Read more1.0.0 · Source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf. Read more1.6.0 · Source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf. Read moreSource§fn read_buf(&mut self, buf: BorrowedCursor<'_, u8>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_, u8>) -> Result<(), Error>
read_buf)Source§fn read_buf_exact(
&mut self,
cursor: BorrowedCursor<'_, u8>,
) -> Result<(), Error>
fn read_buf_exact( &mut self, cursor: BorrowedCursor<'_, u8>, ) -> Result<(), Error>
read_buf)cursor. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read. Read more1.0.0 · Source§fn chain<R>(self, next: R) -> Chain<Self, R> ⓘ
fn chain<R>(self, next: R) -> Chain<Self, R> ⓘ
1.0.0 · Source§fn take(self, limit: u64) -> Take<Self> ⓘwhere
Self: Sized,
fn take(self, limit: u64) -> Take<Self> ⓘwhere
Self: Sized,
limit bytes from it. Read moreSource§fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Error>where
Self: Sized,
fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Error>where
Self: Sized,
read_array)