Struct async_io_traits::io::OwnedBuf
source · Expand description
TODO docs
Implementations
sourceimpl<A> OwnedBuf<A>where
A: 'static + Allocator,
impl<A> OwnedBuf<A>where
A: 'static + Allocator,
sourcepub fn new(
data: *mut MaybeUninit<u8>,
dtor: &'static (dyn Fn(&mut OwnedBuf<Global>) + 'static),
capacity: usize,
filled: usize,
init: usize
) -> OwnedBuf<Global>
pub fn new(
data: *mut MaybeUninit<u8>,
dtor: &'static (dyn Fn(&mut OwnedBuf<Global>) + 'static),
capacity: usize,
filled: usize,
init: usize
) -> OwnedBuf<Global>
TODO docs
sourcepub fn new_in(
data: *mut MaybeUninit<u8>,
dtor: &'static (dyn Fn(&mut OwnedBuf<A>) + 'static),
capacity: usize,
filled: usize,
init: usize,
allocator: A
) -> OwnedBuf<A>
pub fn new_in(
data: *mut MaybeUninit<u8>,
dtor: &'static (dyn Fn(&mut OwnedBuf<A>) + 'static),
capacity: usize,
filled: usize,
init: usize,
allocator: A
) -> OwnedBuf<A>
TODO docs
sourcepub unsafe fn into_uninit_vec(self) -> Vec<MaybeUninit<u8>, A>
pub unsafe fn into_uninit_vec(self) -> Vec<MaybeUninit<u8>, A>
TODO docs
sourcepub fn filled(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
pub fn filled(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Returns a shared reference to the filled portion of the buffer.
sourcepub fn unfilled(&mut self) -> OwnedCursor<'_, A>
pub fn unfilled(&mut self) -> OwnedCursor<'_, A>
Returns a cursor over the unfilled part of the buffer.
sourcepub fn clear(&mut self) -> &mut OwnedBuf<A>
pub fn clear(&mut self) -> &mut OwnedBuf<A>
Clears the buffer, resetting the filled region to empty.
The number of initialized bytes is not changed, and the contents of the buffer are not modified.
sourcepub unsafe fn set_init(&mut self, n: usize) -> &mut OwnedBuf<A>
pub unsafe fn set_init(&mut self, n: usize) -> &mut OwnedBuf<A>
Asserts that the first n
bytes of the buffer are initialized.
OwnedBuf
assumes that bytes are never de-initialized, so this method does nothing when called with fewer
bytes than are already known to be initialized.
Safety
The caller must ensure that the first n
unfilled bytes of the buffer have already been initialized.
Trait Implementations
Auto Trait Implementations
impl<A = Global> !RefUnwindSafe for OwnedBuf<A>
impl<A = Global> !Send for OwnedBuf<A>
impl<A = Global> !Sync for OwnedBuf<A>
impl<A> Unpin for OwnedBuf<A>where
A: Unpin,
impl<A = Global> !UnwindSafe for OwnedBuf<A>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more