pub struct BorrowedRawAllocation<'a> { /* private fields */ }
Expand description

Represents the unique borrow of a contiguous piece of a single allocation with some layout that is used as a data copying destination. May be wholly or partially uninitialized.

This type can only be obtained through the borrow_as_slab method on RawAllocation.

Trait Implementations§

source§

impl<'a> Slab for BorrowedRawAllocation<'a>

source§

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

Get a pointer to the beginning of the allocation represented by self.
source§

fn size(&self) -> usize

Get the size of the allocation represented by self.
source§

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>]

Interpret a portion of self as a mutable slice of MaybeUninit<u8>.
source§

unsafe fn assume_initialized_as_bytes(&self) -> &[u8]

Interpret self as a byte slice. This assumes that all bytes in self are initialized. Read more
source§

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 more
source§

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 more
source§

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 more
source§

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 more
source§

fn as_ffi_readback_buffer<R>(&mut self, range: R) -> (*mut 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 be filled and then read using one or more of the read_ helper functions. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.