pub struct HeapSlab { /* private fields */ }
Available on crate feature
std
only.Implementations§
Trait Implementations§
source§impl Slab for HeapSlab
impl Slab for HeapSlab
source§fn base_ptr(&self) -> *const u8
fn base_ptr(&self) -> *const u8
Get a pointer to the beginning of the allocation represented by
self
.source§fn base_ptr_mut(&mut self) -> *mut u8
fn base_ptr_mut(&mut self) -> *mut u8
Get a pointer to the beginning of the allocation represented by
self
.source§fn as_maybe_uninit_bytes(&self) -> &[MaybeUninit<u8>]
fn as_maybe_uninit_bytes(&self) -> &[MaybeUninit<u8>]
Interpret a portion of
self
as a slice of MaybeUninit<u8>
. This is likely not
incredibly useful, you probably want to use Slab::as_maybe_uninit_bytes_mut
source§fn as_maybe_uninit_bytes_mut(&mut self) -> &mut [MaybeUninit<u8>]
fn as_maybe_uninit_bytes_mut(&mut self) -> &mut [MaybeUninit<u8>]
Interpret a portion of
self
as a mutable slice of MaybeUninit<u8>
.source§unsafe fn assume_initialized_as_bytes(&self) -> &[u8] ⓘ
unsafe fn assume_initialized_as_bytes(&self) -> &[u8] ⓘ
source§unsafe fn assume_initialized_as_bytes_mut(&mut self) -> &mut [u8] ⓘ
unsafe fn assume_initialized_as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Interpret
self
as a mutable byte slice. This assumes that all bytes
in self
are initialized. Read moresource§unsafe fn assume_range_initialized_as_bytes<R>(&self, range: R) -> &[u8] ⓘwhere
R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
unsafe fn assume_range_initialized_as_bytes<R>(&self, range: R) -> &[u8] ⓘwhere R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
Interpret a range of
self
as a byte slice. This assumes that all bytes
within range
are initialized. Read moresource§unsafe fn assume_range_initialized_as_bytes_mut<R>(
&mut self,
range: R
) -> &mut [u8] ⓘwhere
R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
unsafe fn assume_range_initialized_as_bytes_mut<R>( &mut self, range: R ) -> &mut [u8] ⓘwhere R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
Interpret a range of
self
as a mutable byte slice. This assumes that all bytes
within range
are initialized. Read moresource§fn as_ffi_buffer<R>(&self, range: R) -> (*const c_void, usize)where
R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
fn as_ffi_buffer<R>(&self, range: R) -> (*const c_void, usize)where R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
View a portion of
self
as a c_void
pointer and size, appropriate for sending to an FFI function
to have it read the contents of self
. If you want the buffer to be filled with data
from the other side of the ffi and then read it back, use
as_ffi_readback_buffer
instead. Read moresource§fn as_ffi_readback_buffer<R>(&mut self, range: R) -> (*mut c_void, usize)where
R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
fn as_ffi_readback_buffer<R>(&mut self, range: R) -> (*mut c_void, usize)where R: SliceIndex<[MaybeUninit<u8>], Output = [MaybeUninit<u8>]>,
Auto Trait Implementations§
impl RefUnwindSafe for HeapSlab
impl !Send for HeapSlab
impl !Sync for HeapSlab
impl Unpin for HeapSlab
impl UnwindSafe for HeapSlab
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