Skip to main content

SetLen

Trait SetLen 

pub trait SetLen {
    // Required method
    unsafe fn set_len(&mut self, len: usize);
}
Expand description

A helper trait for set_len like methods.

Required Methods§

unsafe fn set_len(&mut self, len: usize)

Set the buffer length.

§Safety
  • len must be less or equal than as_uninit().len().
  • The bytes in the range [buf_len(), len) must be initialized.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl SetLen for ()

§

unsafe fn set_len(&mut self, len: usize)

§

impl SetLen for [u8]

§

unsafe fn set_len(&mut self, len: usize)

§

impl<B> SetLen for &'static mut B
where B: SetLen + ?Sized,

§

unsafe fn set_len(&mut self, len: usize)

§

impl<T, Rest> SetLen for (T, Rest)
where T: IoBufMut, Rest: IoVectoredBufMut,

§

unsafe fn set_len(&mut self, len: usize)

§

impl<T, const N: usize> SetLen for [T; N]
where T: IoBufMut,

§

unsafe fn set_len(&mut self, len: usize)

§

impl<T> SetLen for (T,)
where T: IoBufMut,

§

unsafe fn set_len(&mut self, len: usize)

§

impl<T> SetLen for [T]
where T: IoBufMut,

§

unsafe fn set_len(&mut self, len: usize)

§

impl<const N: usize> SetLen for [u8; N]

§

unsafe fn set_len(&mut self, len: usize)

Implementors§

§

impl SetLen for BorrowedBuf<'static, u8>

Available on crate feature read_buf only.
§

impl SetLen for BufferRef

§

impl SetLen for BytesMut

Available on crate feature bytes only.
§

impl SetLen for MmapMut

Available on crate feature memmap2 only.
§

impl<A> SetLen for Vec<u8, A>
where A: Allocator + 'static,

§

impl<B, A> SetLen for Box<B, A>
where B: SetLen + ?Sized, A: Allocator + 'static,

§

impl<T, A> SetLen for Vec<T, A>
where T: IoBufMut, A: Allocator + 'static,

§

impl<T, const N: usize> SetLen for ArrayVec<T, N>
where T: IoBufMut,

Available on crate feature arrayvec only.
§

impl<T, const N: usize> SetLen for SmallVec<[T; N]>
where T: IoBufMut, [T; N]: Array<Item = T>,

Available on crate feature smallvec only.
§

impl<T> SetLen for Slice<T>
where T: SetLen,

§

impl<T> SetLen for Uninit<T>
where T: SetLen + IoBuf,

§

impl<T> SetLen for VectoredBufIter<T>
where T: IoVectoredBuf + SetLen,

§

impl<T> SetLen for VectoredSlice<T>
where T: SetLen,

§

impl<const N: usize> SetLen for AncillaryBuf<N>

§

impl<const N: usize> SetLen for ArrayVec<u8, N>

Available on crate feature arrayvec only.
§

impl<const N: usize> SetLen for SmallVec<[u8; N]>
where [u8; N]: Array<Item = u8>,

Available on crate feature smallvec only.