Struct wasmer::SharedMemory
source · 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
§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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