Struct Chain
struct Chain<T, U> { ... }
A Chain sequences two buffers.
Chain is an adapter that links two underlying buffers and provides a
continuous view across both buffers. It is able to sequence either immutable
buffers (Buf values) or mutable buffers (BufMut values).
This struct is generally created by calling Buf::chain. Please see that
function's documentation for more detail.
Examples
use ;
let mut buf =
.chain;
let full: Bytes = buf.copy_to_bytes;
assert_eq!;
Implementations
impl<T, U> Chain<T, U>
fn first_ref(self: &Self) -> &TGets a reference to the first underlying
Buf.Examples
use Buf; let buf = .chain; assert_eq!;fn first_mut(self: &mut Self) -> &mut TGets a mutable reference to the first underlying
Buf.Examples
use Buf; let mut buf = .chain; buf.first_mut.advance; let full = buf.copy_to_bytes; assert_eq!;fn last_ref(self: &Self) -> &UGets a reference to the last underlying
Buf.Examples
use Buf; let buf = .chain; assert_eq!;fn last_mut(self: &mut Self) -> &mut UGets a mutable reference to the last underlying
Buf.Examples
use Buf; let mut buf = .chain; buf.last_mut.advance; let full = buf.copy_to_bytes; assert_eq!;fn into_inner(self: Self) -> (T, U)Consumes this
Chain, returning the underlying values.Examples
use Buf; let chain = .chain; let = chain.into_inner; assert_eq!; assert_eq!;
impl<T> Any for Chain<T, U>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Chain<T, U>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Chain<T, U>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Chain<T, U>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Buf for Chain<T, U>
fn remaining(self: &Self) -> usizefn chunk(self: &Self) -> &[u8]fn advance(self: &mut Self, cnt: usize)fn chunks_vectored<'a>(self: &'a Self, dst: &mut [IoSlice<'a>]) -> usizefn copy_to_bytes(self: &mut Self, len: usize) -> Bytes
impl<T, U> BufMut for Chain<T, U>
fn remaining_mut(self: &Self) -> usizefn chunk_mut(self: &mut Self) -> &mut UninitSliceunsafe fn advance_mut(self: &mut Self, cnt: usize)
impl<T, U> Freeze for Chain<T, U>
impl<T, U> Into for Chain<T, U>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> IntoIterator for Chain<T, U>
fn into_iter(self: Self) -> <Self as >::IntoIter
impl<T, U> RefUnwindSafe for Chain<T, U>
impl<T, U> Send for Chain<T, U>
impl<T, U> Sync for Chain<T, U>
impl<T, U> TryFrom for Chain<T, U>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Chain<T, U>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T, U> Unpin for Chain<T, U>
impl<T, U> UnsafeUnpin for Chain<T, U>
impl<T, U> UnwindSafe for Chain<T, U>
impl<T: $crate::fmt::Debug, U: $crate::fmt::Debug> Debug for Chain<T, U>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result