Struct IoSliceMut
struct IoSliceMut<'a>(_)
A buffer type used with Read::read_vectored.
It is semantically a wrapper around a &mut [u8], but is guaranteed to be
ABI compatible with the iovec type on Unix platforms and WSABUF on
Windows.
Implementations
impl<'a> IoSliceMut<'a>
fn new(buf: &'a mut [u8]) -> IoSliceMut<'a>Creates a new
IoSliceMutwrapping a byte slice.Panics
Panics on Windows if the slice is larger than 4GB.
fn advance(self: &mut Self, n: usize)Advance the internal cursor of the slice.
Also see
IoSliceMut::advance_slicesto advance the cursors of multiple buffers.Panics
Panics when trying to advance beyond the end of the slice.
Examples
use IoSliceMut; use Deref; let mut data = ; let mut buf = new; // Mark 3 bytes as read. buf.advance; assert_eq!;fn advance_slices(bufs: &mut &mut [IoSliceMut<'a>], n: usize)Advance a slice of slices.
Shrinks the slice to remove any
IoSliceMuts that are fully advanced over. If the cursor ends up in the middle of anIoSliceMut, it is modified to start at that cursor.For example, if we have a slice of two 8-byte
IoSliceMuts, and we advance by 10 bytes, the result will only include the secondIoSliceMut, advanced by 2 bytes.Panics
Panics when trying to advance beyond the end of the slices.
Examples
use IoSliceMut; use Deref; let mut buf1 = ; let mut buf2 = ; let mut buf3 = ; let mut bufs = &mut ; // Mark 10 bytes as read. advance_slices; assert_eq!; assert_eq!;const fn into_slice(self: Self) -> &'a mut [u8]Get the underlying bytes as a mutable slice with the original lifetime.
Examples
use IoSliceMut; let mut data = *b"abcdef"; let io_slice = new; io_slice.into_slice = b'A'; assert_eq!;
impl<'a> Debug for IoSliceMut<'a>
fn fmt(self: &Self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result
impl<'a> Deref for IoSliceMut<'a>
fn deref(self: &Self) -> &[u8]
impl<'a> DerefMut for IoSliceMut<'a>
fn deref_mut(self: &mut Self) -> &mut [u8]
impl<'a> Freeze for IoSliceMut<'a>
impl<'a> RefUnwindSafe for IoSliceMut<'a>
impl<'a> Send for IoSliceMut<'a>
impl<'a> Sync for IoSliceMut<'a>
impl<'a> Unpin for IoSliceMut<'a>
impl<'a> UnwindSafe for IoSliceMut<'a>
impl<P, T> Receiver for IoSliceMut<'a>
impl<T> Any for IoSliceMut<'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for IoSliceMut<'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for IoSliceMut<'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for IoSliceMut<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for IoSliceMut<'a>
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> TryFrom for IoSliceMut<'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for IoSliceMut<'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>