pub struct Chain<A, B> { /* private fields */ }Expand description
The chain adapter.
See: Buf::chain and BufMut::chain.
Implementations§
Source§impl<A, B> Chain<A, B>
impl<A, B> Chain<A, B>
Sourcepub fn first_mut(&mut self) -> &mut A
pub fn first_mut(&mut self) -> &mut A
Get a mutable reference to the first buffer in the chain.
Sourcepub fn second_mut(&mut self) -> &mut B
pub fn second_mut(&mut self) -> &mut B
Get a mutable reference to the second buffer in the chain.
Sourcepub fn into_first(self) -> A
pub fn into_first(self) -> A
Destruct the adapter and get back the first buffer.
Sourcepub fn into_second(self) -> B
pub fn into_second(self) -> B
Destruct the adapter and get back the second buffer.
Sourcepub fn into_inner(self) -> (A, B)
pub fn into_inner(self) -> (A, B)
Destruct the adapter and get back both buffers.
Trait Implementations§
Source§impl<A, B> Buf for Chain<A, B>
impl<A, B> Buf for Chain<A, B>
Source§fn advance(&mut self, n: usize)
fn advance(&mut self, n: usize)
Advance the internal cursor of the buffer by
n bytes. Read moreSource§fn has_remaining(&self) -> bool
fn has_remaining(&self) -> bool
Check whether the buffer has any data left in it.
Source§fn copy_to_slice(&mut self, slice: &mut [u8]) -> usize
fn copy_to_slice(&mut self, slice: &mut [u8]) -> usize
Copy data from the buffer into
slice advancing the buffer accordingly.Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Create a “by reference” adapter that takes the current instance of
Buf
by mutable reference.Source§impl<A, B> BufMut for Chain<A, B>
impl<A, B> BufMut for Chain<A, B>
Source§fn remaining_mut(&self) -> usize
fn remaining_mut(&self) -> usize
Get the number of bytes this buffer can hold.
Source§fn chunk_mut(&mut self) -> &mut [u8] ⓘ
fn chunk_mut(&mut self) -> &mut [u8] ⓘ
Get the remaining part of the buffer as a mutable slice. Read more
Source§fn advance_mut(&mut self, n: usize)
fn advance_mut(&mut self, n: usize)
Advance the internal cursor of the buffer by
n bytes. Read moreSource§fn has_remaining_mut(&self) -> bool
fn has_remaining_mut(&self) -> bool
Check whether the buffer has any data left in it.
Source§fn copy_from_slice(&mut self, slice: &[u8]) -> usize
fn copy_from_slice(&mut self, slice: &[u8]) -> usize
Copy data from the buffer into
slice advancing the buffer accordingly.Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Create a “by reference” adapter that takes the current instance of
BufMut
by mutable reference.Source§fn writer(self) -> Writer<Self>where
Self: Sized,
fn writer(self) -> Writer<Self>where
Self: Sized,
Create an adapter that implements the
Write and AsyncWrite traits
on the current instance of BufMut.impl<A, B> Copy for Chain<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for Chain<A, B>
impl<A, B> RefUnwindSafe for Chain<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Chain<A, B>
impl<A, B> Sync for Chain<A, B>
impl<A, B> Unpin for Chain<A, B>
impl<A, B> UnwindSafe for Chain<A, B>where
A: UnwindSafe,
B: UnwindSafe,
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