Struct Pair

Source
pub struct Pair<Part> { /* private fields */ }

Implementations§

Source§

impl<'a> Pair<&'a [MaybeUninit<u8>]>

Source

pub unsafe fn assume_init_io_slice(self) -> Pair<IoSlice<'a>>

§Safety

Callers should guarantee the memory in the pair is initialized

Source§

impl<'a> Pair<&'a mut [MaybeUninit<u8>]>

Source

pub unsafe fn assume_init_io_slice_mut(self) -> Pair<IoSliceMut<'a>>

§Safety

Callers should guarantee the memory in the pair is initialized

Source§

impl<Part> Pair<Part>
where Part: Storage,

Source

pub fn reader_slice(&mut self) -> &[Part]

Source

pub fn reader_slice_mut(&mut self) -> &mut [Part]

Source§

impl<Part> Pair<Part>
where Part: Storage,

Source

pub fn writer_slice(&mut self) -> &[Part]

Source

pub fn writer_slice_mut(&mut self) -> &mut [Part]

Source§

impl<T> Pair<T>

Source

pub fn map<F, U>(self, f: F) -> Pair<U>
where F: FnMut(T) -> U,

Source§

impl<Part, T> Pair<Part>
where Part: Deref<Target = [T]>,

Source

pub fn get(&self, index: usize) -> Option<&T>

Source

pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>
where T: 'a,

Source§

impl<Part, T> Pair<Part>
where Part: DerefMut<Target = [T]>,

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut T>

Source

pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T> + 'a
where T: 'a,

Source§

impl<'a, T> Pair<&'a [MaybeUninit<T>]>

Source

pub unsafe fn assume_init_ref(self) -> Pair<&'a [T]>

§Safety

Callers should guarantee the memory in the pair is initialized

Source§

impl<'a, T> Pair<&'a mut [MaybeUninit<T>]>

Source

pub unsafe fn assume_init_mut(self) -> Pair<&'a mut [T]>

§Safety

Callers should guarantee the memory in the pair is initialized

Trait Implementations§

Source§

impl<Part> From<(Part, Part)> for Pair<Part>

Source§

fn from((head, tail): (Part, Part)) -> Self

Converts to this type from the input type.
Source§

impl<Part> From<Pair<Part>> for (Part, Part)

Source§

fn from(pair: Pair<Part>) -> (Part, Part)

Converts to this type from the input type.
Source§

impl<S: Storage> Storage for Pair<S>

Source§

type Error = <S as Storage>::Error

Source§

fn buffered_len(&self) -> usize

Returns the length of the chunk
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 buffer_is_empty(&self) -> bool

Returns if the chunk is empty
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
Source§

impl<S: Storage> Storage for Pair<S>

Source§

fn put_slice(&mut self, bytes: &[u8])

Writes a slice of bytes into the storage Read more
Source§

fn put_uninit_slice<F, Error>( &mut self, payload_len: usize, f: F, ) -> Result<bool, Error>
where F: FnOnce(&mut UninitSlice) -> Result<(), Error>,

Tries to write into a uninit slice for the current storage Read more
Source§

fn remaining_capacity(&self) -> usize

Returns the additional number of bytes that can be written to the storage
Source§

const SPECIALIZES_BYTES: bool = false

Source§

const SPECIALIZES_BYTES_MUT: bool = false

Source§

fn has_remaining_capacity(&self) -> bool

Returns true if the storage will accept any additional bytes
Source§

fn put_bytes(&mut self, bytes: Bytes)

Writes Bytes into the storage Read more
Source§

fn put_bytes_mut(&mut self, bytes: BytesMut)

Writes BytesMut into the storage Read more
Source§

fn put_chunk(&mut self, chunk: Chunk<'_>)

Writes a reader Chunk into the storage
Source§

fn with_write_limit(&mut self, max_len: usize) -> Limit<'_, Self>

Limits the number of bytes that can be written to the storage
Source§

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

Tracks the number of bytes written to the storage
Source§

fn write_once(&mut self) -> WriteOnce<'_, Self>

Only allows a single write into the storage. After that, no more writes are allowed. Read more

Auto Trait Implementations§

§

impl<Part> Freeze for Pair<Part>
where Part: Freeze,

§

impl<Part> RefUnwindSafe for Pair<Part>
where Part: RefUnwindSafe,

§

impl<Part> Send for Pair<Part>
where Part: Send,

§

impl<Part> Sync for Pair<Part>
where Part: Sync,

§

impl<Part> Unpin for Pair<Part>
where Part: Unpin,

§

impl<Part> UnwindSafe for Pair<Part>
where Part: UnwindSafe,

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