pub struct ClonableSeek<'reader, R: Read<Error: Copy> + Seek> { /* private fields */ }
Expand description
A wrapper which allows cheaply and safely cloning implementors of Seek
.
This defers ownership of the reader for solely ownership of a reference to it. Each instance individually tracks their position within the reader, resetting the seek head on each invocation (as required for each instance to maintain a consistent view).
Trait Implementations§
Source§impl<'reader, R: Read<Error: Copy> + Seek> Read for ClonableSeek<'reader, R>
impl<'reader, R: Read<Error: Copy> + Seek> Read for ClonableSeek<'reader, R>
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf
. Read moreSource§impl<'reader, R: Read<Error: Copy> + Seek> Seek for ClonableSeek<'reader, R>
impl<'reader, R: Read<Error: Copy> + Seek> Seek for ClonableSeek<'reader, R>
Source§fn seek(&mut self, pos: SeekFrom) -> Result<u64, Self::Error>
fn seek(&mut self, pos: SeekFrom) -> Result<u64, Self::Error>
Seek to an offset, in bytes, in a stream.
A seek beyond the end of a stream is allowed, but behavior is defined
by the implementation. Read more
Source§fn rewind(&mut self) -> Result<(), Self::Error>
fn rewind(&mut self) -> Result<(), Self::Error>
Rewind to the beginning of a stream. Read more
Auto Trait Implementations§
impl<'reader, R> Freeze for ClonableSeek<'reader, R>
impl<'reader, R> !RefUnwindSafe for ClonableSeek<'reader, R>
impl<'reader, R> !Send for ClonableSeek<'reader, R>
impl<'reader, R> !Sync for ClonableSeek<'reader, R>
impl<'reader, R> Unpin for ClonableSeek<'reader, R>
impl<'reader, R> !UnwindSafe for ClonableSeek<'reader, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more