FullCopy

Struct FullCopy 

Source
pub struct FullCopy<'a, S: Storage + ?Sized>(/* private fields */);
Expand description

Forces a full copy, even when partial_copy_into is called

Implementations§

Source§

impl<'a, S: Storage + ?Sized> FullCopy<'a, S>

Source

pub fn new(storage: &'a mut S) -> Self

Trait Implementations§

Source§

impl<'a, S: Debug + Storage + ?Sized> Debug for FullCopy<'a, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Storage + ?Sized> Storage for FullCopy<'_, S>

Source§

type Error = <S as Storage>::Error

Source§

fn buffered_len(&self) -> usize

Returns the length of the chunk
Source§

fn buffer_is_empty(&self) -> bool

Returns if the chunk is empty
Source§

fn read_chunk(&mut self, watermark: usize) -> Result<Chunk<'_>, Self::Error>

Reads the current contiguous chunk
Source§

fn partial_copy_into<Dest>( &mut self, dest: &mut Dest, ) -> Result<Chunk<'_>, Self::Error>
where Dest: Storage + ?Sized,

Copies the reader into dest, with a trailing chunk of bytes. Read more
Source§

fn copy_into<Dest>(&mut self, dest: &mut Dest) -> Result<(), Self::Error>
where Dest: Storage + ?Sized,

Copies the reader into dest. Read more
Source§

fn full_copy(&mut self) -> FullCopy<'_, Self>

Forces the entire reader to be copied, even when calling partial_copy_into. Read more
Source§

fn track_read(&mut self) -> Tracked<'_, Self>

Tracks the number of bytes read from the storage

Auto Trait Implementations§

§

impl<'a, S> Freeze for FullCopy<'a, S>
where S: ?Sized,

§

impl<'a, S> RefUnwindSafe for FullCopy<'a, S>
where S: RefUnwindSafe + ?Sized,

§

impl<'a, S> Send for FullCopy<'a, S>
where S: Send + ?Sized,

§

impl<'a, S> Sync for FullCopy<'a, S>
where S: Sync + ?Sized,

§

impl<'a, S> Unpin for FullCopy<'a, S>
where S: ?Sized,

§

impl<'a, S> !UnwindSafe for FullCopy<'a, S>

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> Infallible for T
where T: Storage<Error = Infallible> + ?Sized,

Source§

fn infallible_read_chunk(&mut self, watermark: usize) -> Chunk<'_>

Source§

fn infallible_partial_copy_into<Dest>(&mut self, dest: &mut Dest) -> Chunk<'_>
where Dest: Storage + ?Sized,

Source§

fn infallible_copy_into<Dest>(&mut self, dest: &mut Dest)
where Dest: Storage + ?Sized,

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.
Source§

impl<T, U> Upcast<T> for U
where T: UpcastFrom<U>,

Source§

fn upcast(self) -> T

Source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

Source§

fn upcast_from(value: Counter<T, B>) -> T