ClonableSeek

Struct ClonableSeek 

Source
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> Clone for ClonableSeek<'reader, R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'reader, R: Read<Error: Copy> + Seek> ErrorType for ClonableSeek<'reader, R>

Source§

type Error = <R as ErrorType>::Error

Error type of all the IO operations on this type.
Source§

impl<'reader, R: Read<Error: Copy> + Seek> Read for ClonableSeek<'reader, R>

Source§

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

Read the exact number of bytes required to fill buf. Read more
Source§

impl<'reader, R: Read<Error: Copy> + Seek> Seek for ClonableSeek<'reader, R>

Source§

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>

Rewind to the beginning of a stream. Read more
Source§

fn stream_position(&mut self) -> Result<u64, Self::Error>

Returns the current seek position from the start of the stream. Read more
Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Self::Error>

Seeks relative to the current position. Read more
Source§

impl<'reader, R: Read<Error: Copy> + Seek> TryFrom<&'reader RefCell<R>> for ClonableSeek<'reader, R>

Source§

type Error = <R as ErrorType>::Error

The type returned in the event of a conversion error.
Source§

fn try_from(reader: &'reader RefCell<R>) -> Result<Self, R::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'reader, R> Freeze for ClonableSeek<'reader, R>
where <R as ErrorType>::Error: Sized,

§

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>
where <R as ErrorType>::Error: Sized,

§

impl<'reader, R> !UnwindSafe for ClonableSeek<'reader, R>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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, 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.