pub struct Slice<B> { /* private fields */ }Expand description
A bounded view into an owned IoBuf or IoBufMut buffer.
Allows passing a subset of a buffer to an I/O operation without
splitting or consuming it. The original buffer is reclaimed via
into_inner after the operation completes.
Implementations§
Trait Implementations§
Source§impl<B: IoBuf> IoBuf for Slice<B>
impl<B: IoBuf> IoBuf for Slice<B>
Source§fn stable_ptr(&self) -> *const u8
fn stable_ptr(&self) -> *const u8
Returns a stable pointer to the start of the initialized data.
Source§fn bytes_init(&self) -> usize
fn bytes_init(&self) -> usize
Number of initialized bytes, valid to read.
Source§fn bytes_total(&self) -> usize
fn bytes_total(&self) -> usize
Total capacity, including uninitialized memory.
This is what gets passed to the kernel for reads.
Auto Trait Implementations§
impl<B> Freeze for Slice<B>where
B: Freeze,
impl<B> RefUnwindSafe for Slice<B>where
B: RefUnwindSafe,
impl<B> Send for Slice<B>where
B: Send,
impl<B> Sync for Slice<B>where
B: Sync,
impl<B> Unpin for Slice<B>where
B: Unpin,
impl<B> UnsafeUnpin for Slice<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for Slice<B>where
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