Skip to main content

IoBuf

Trait IoBuf 

Source
pub trait IoBuf: 'static {
    // Required method
    fn as_init(&self) -> &[u8] ;
}
Expand description

A trait for immutable buffers.

The IoBuf trait is implemented by buffer types that can be passed to immutable completion-based IO operations, like writing its content to a file. This trait will only take initialized bytes of a buffer into account.

Required Methods§

Source

fn as_init(&self) -> &[u8]

Get the slice of initialized bytes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IoBuf for [u8]

Source§

fn as_init(&self) -> &[u8]

Source§

impl IoBuf for str

Source§

fn as_init(&self) -> &[u8]

Source§

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

Source§

fn as_init(&self) -> &[u8]

Source§

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

Source§

fn as_init(&self) -> &[u8]

Source§

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

Source§

fn as_init(&self) -> &[u8]

Implementors§

Source§

impl IoBuf for BorrowedBuf<'static, u8>

Available on crate feature read_buf only.
Source§

impl IoBuf for BufferRef

Source§

impl IoBuf for Bytes

Available on crate feature bytes only.
Source§

impl IoBuf for BytesMut

Available on crate feature bytes only.
Source§

impl IoBuf for Mmap

Available on crate feature memmap2 only.
Source§

impl IoBuf for MmapMut

Available on crate feature memmap2 only.
Source§

impl IoBuf for String

Source§

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

Source§

impl<B, A> IoBuf for Arc<B, A>
where B: IoBuf + ?Sized, A: Allocator + 'static,

Source§

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

Source§

impl<B, A> IoBuf for Rc<B, A>
where B: IoBuf + ?Sized, A: Allocator + 'static,

Source§

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

Source§

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

Source§

impl<T> IoBuf for VectoredBufIter<T>
where T: IoVectoredBuf,

Source§

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

Source§

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

Available on crate feature arrayvec only.
Source§

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

Available on crate feature smallvec only.