Struct wasmer_wasix::os::task::process::WasiProcess
source · pub struct WasiProcess { /* private fields */ }
Expand description
Represents a process running within the compute state
Implementations§
source§impl WasiProcess
impl WasiProcess
pub fn new(pid: WasiProcessId, plane: WasiControlPlaneHandle) -> Self
sourcepub fn pid(&self) -> WasiProcessId
pub fn pid(&self) -> WasiProcessId
Gets the process ID of this process
sourcepub fn ppid(&self) -> WasiProcessId
pub fn ppid(&self) -> WasiProcessId
Gets the process ID of the parent process
sourcepub fn write(&self) -> RwLockWriteGuard<'_, WasiProcessInner>
pub fn write(&self) -> RwLockWriteGuard<'_, WasiProcessInner>
Gains write access to the process internals
sourcepub fn read(&self) -> RwLockReadGuard<'_, WasiProcessInner>
pub fn read(&self) -> RwLockReadGuard<'_, WasiProcessInner>
Gains read access to the process internals
sourcepub fn new_thread(&self) -> Result<WasiThreadHandle, ControlPlaneError>
pub fn new_thread(&self) -> Result<WasiThreadHandle, ControlPlaneError>
Creates a a thread and returns it
sourcepub fn get_thread(&self, tid: &WasiThreadId) -> Option<WasiThread>
pub fn get_thread(&self, tid: &WasiThreadId) -> Option<WasiThread>
Gets a reference to a particular thread
sourcepub fn signal_thread(&self, tid: &WasiThreadId, signal: Signal)
pub fn signal_thread(&self, tid: &WasiThreadId, signal: Signal)
Signals a particular thread in the process
sourcepub fn signal_process(&self, signal: Signal)
pub fn signal_process(&self, signal: Signal)
Signals all the threads in this process
sourcepub fn signal_interval(
&self,
signal: Signal,
interval: Option<Duration>,
repeat: bool
)
pub fn signal_interval( &self, signal: Signal, interval: Option<Duration>, repeat: bool )
Signals one of the threads every interval
sourcepub fn active_threads(&self) -> u32
pub fn active_threads(&self) -> u32
Returns the number of active threads for this process
sourcepub async fn join(&self) -> Result<ExitCode, Arc<WasiRuntimeError>>
pub async fn join(&self) -> Result<ExitCode, Arc<WasiRuntimeError>>
Waits until the process is finished.
sourcepub fn try_join(&self) -> Option<Result<ExitCode, Arc<WasiRuntimeError>>>
pub fn try_join(&self) -> Option<Result<ExitCode, Arc<WasiRuntimeError>>>
Attempts to join on the process
sourcepub async fn join_children(
&mut self
) -> Option<Result<ExitCode, Arc<WasiRuntimeError>>>
pub async fn join_children( &mut self ) -> Option<Result<ExitCode, Arc<WasiRuntimeError>>>
Waits for all the children to be finished
sourcepub async fn join_any_child(
&mut self
) -> Result<Option<(WasiProcessId, ExitCode)>, Errno>
pub async fn join_any_child( &mut self ) -> Result<Option<(WasiProcessId, ExitCode)>, Errno>
Waits for any of the children to finished
Trait Implementations§
source§impl Clone for WasiProcess
impl Clone for WasiProcess
source§fn clone(&self) -> WasiProcess
fn clone(&self) -> WasiProcess
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WasiProcess
impl Debug for WasiProcess
source§impl SignalHandlerAbi for WasiProcess
impl SignalHandlerAbi for WasiProcess
Auto Trait Implementations§
impl !RefUnwindSafe for WasiProcess
impl Send for WasiProcess
impl Sync for WasiProcess
impl Unpin for WasiProcess
impl !UnwindSafe for WasiProcess
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
source§impl<T> Upcastable for Twhere
T: Any + Debug + 'static,
impl<T> Upcastable for Twhere T: Any + Debug + 'static,
§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref