pub struct SharedMemory { /* private fields */ }
Expand description
A handle that exposes operations only relevant for shared memories.
Enables interaction independent from the crate::Store
, and thus allows calling
some methods an instane is running.
NOTE: Not all methods are supported by all backends.
Implementations§
Sourcepub fn notify(
&self,
location: MemoryLocation,
count: u32,
) -> Result<u32, AtomicsError>
pub fn notify( &self, location: MemoryLocation, count: u32, ) -> Result<u32, AtomicsError>
Notify up to count
waiters waiting for the memory location.
Sourcepub fn wait(
&self,
location: MemoryLocation,
timeout: Option<Duration>,
) -> Result<u32, AtomicsError>
pub fn wait( &self, location: MemoryLocation, timeout: Option<Duration>, ) -> Result<u32, AtomicsError>
Wait for the memory location to be notified.
Sourcepub fn disable_atomics(&self) -> Result<(), MemoryError>
pub fn disable_atomics(&self) -> Result<(), MemoryError>
Disable atomics for this memory.
All subsequent atomic wait calls will produce a trap.
This can be used or forced shutdown of instances that continuously try to wait on atomics.
NOTE: this operation might not be supported by all memory implementations. In that case, this function will return an error.
Sourcepub fn wake_all_atomic_waiters(&self) -> Result<(), MemoryError>
pub fn wake_all_atomic_waiters(&self) -> Result<(), MemoryError>
Wake up all atomic waiters.
This can be used to force-resume waiting execution.
NOTE: this operation might not be supported by all memory implementations. In that case, this function will return an error.
Trait Implementations§
Source§fn clone(&self) -> SharedMemory
fn clone(&self) -> SharedMemory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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