pub struct Wait { /* private fields */ }Expand description
Wait object used to coordinate or interrupt long-running operations.
Implementations§
Source§impl Wait
impl Wait
Sourcepub fn new(manual_reset: bool, initial_state: bool) -> Result<Self>
pub fn new(manual_reset: bool, initial_state: bool) -> Result<Self>
Create a new wait-handle-backed event object.
Sourcepub fn named(
name: &str,
manual_reset: bool,
initial_state: bool,
) -> Result<Self>
pub fn named( name: &str, manual_reset: bool, initial_state: bool, ) -> Result<Self>
Create a named wait event for inter-process synchronization.
Sourcepub fn manual_reset(initial_state: bool) -> Result<Self>
pub fn manual_reset(initial_state: bool) -> Result<Self>
Create a manual-reset wait handle event.
Sourcepub fn auto_reset(initial_state: bool) -> Result<Self>
pub fn auto_reset(initial_state: bool) -> Result<Self>
Create an auto-reset wait handle event.
Sourcepub fn raw_handle(&self) -> HANDLE
pub fn raw_handle(&self) -> HANDLE
Return the underlying Win32 handle.
Sourcepub fn try_clone(&self) -> Result<Self>
pub fn try_clone(&self) -> Result<Self>
Clone this wait handle with shared internal ownership.
This does not duplicate the underlying OS handle.
Sourcepub fn is_signaled(&self) -> Result<bool>
pub fn is_signaled(&self) -> Result<bool>
Check if this wait handle is currently signaled without blocking.
Sourcepub fn wait_timeout(&self, timeout: Duration) -> Result<bool>
pub fn wait_timeout(&self, timeout: Duration) -> Result<bool>
Wait until this handle is signaled or the timeout elapses.
Returns Ok(true) if signaled, Ok(false) on timeout.
Sourcepub fn wait_any(handles: &[&Self]) -> Result<usize>
pub fn wait_any(handles: &[&Self]) -> Result<usize>
Wait until any handle in handles is signaled.
Returns the index of the signaled handle.
Sourcepub fn wait_any_timeout(
handles: &[&Self],
timeout: Duration,
) -> Result<Option<usize>>
pub fn wait_any_timeout( handles: &[&Self], timeout: Duration, ) -> Result<Option<usize>>
Wait until any handle in handles is signaled or timeout elapses.
Returns Ok(Some(index)) for a signaled handle, Ok(None) on timeout.
Sourcepub fn wait_all(handles: &[&Self]) -> Result<()>
pub fn wait_all(handles: &[&Self]) -> Result<()>
Wait until all handles in handles are signaled.
Sourcepub fn wait_all_timeout(handles: &[&Self], timeout: Duration) -> Result<bool>
pub fn wait_all_timeout(handles: &[&Self], timeout: Duration) -> Result<bool>
Wait until all handles in handles are signaled or timeout elapses.
Returns Ok(true) when all are signaled, Ok(false) on timeout.