pub struct IoBuffer { /* private fields */ }
Expand description
An unsafe, 'static
, partially initialized, and mutable buffer.
It contains full information to describe the buffer.
Implementations§
Source§impl IoBuffer
impl IoBuffer
Sourcepub unsafe fn new(
ptr: *mut MaybeUninit<u8>,
len: usize,
capacity: usize,
) -> Self
pub unsafe fn new( ptr: *mut MaybeUninit<u8>, len: usize, capacity: usize, ) -> Self
Create a new IoBuffer
from a raw pointer, a length, and a capacity.
§Safety
The caller must ensure that:
- the pointer is valid for the lifetime of the
IoBuffer
- the length is correct (the content can be uninitialized, but must be accessible)
- The capacity should not be smaller than the length.
- the pointer is not used for anything else while the
IoBuffer
is in use
Sourcepub fn as_ptr(&self) -> *mut MaybeUninit<u8>
pub fn as_ptr(&self) -> *mut MaybeUninit<u8>
Get the pointer to the buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IoBuffer
impl RefUnwindSafe for IoBuffer
impl !Send for IoBuffer
impl !Sync for IoBuffer
impl Unpin for IoBuffer
impl UnwindSafe for IoBuffer
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