Struct shadow_rs::host::memory_manager::AllocdMem
source · pub struct AllocdMem<T>where
T: Pod,{ /* private fields */ }
Expand description
Memory allocated by Shadow, in a remote address space.
Implementations§
source§impl<T> AllocdMem<T>where
T: Pod,
impl<T> AllocdMem<T>where
T: Pod,
sourcepub fn new(ctx: &ThreadContext<'_>, len: usize) -> Self
pub fn new(ctx: &ThreadContext<'_>, len: usize) -> Self
Allocate memory in the current active process.
Must be freed explicitly via free
.
sourcepub fn ptr(&self) -> ForeignArrayPtr<T>
pub fn ptr(&self) -> ForeignArrayPtr<T>
Pointer to the allocated memory.
pub fn free(self, ctx: &ThreadContext<'_>)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AllocdMem<T>
impl<T> RefUnwindSafe for AllocdMem<T>where
T: RefUnwindSafe,
impl<T> Send for AllocdMem<T>where
T: Send,
impl<T> Sync for AllocdMem<T>where
T: Sync,
impl<T> Unpin for AllocdMem<T>where
T: Unpin,
impl<T> UnwindSafe for AllocdMem<T>where
T: UnwindSafe + RefUnwindSafe,
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more