Skip to main content

Wait

Struct Wait 

Source
pub struct Wait { /* private fields */ }
Expand description

Wait object used to coordinate or interrupt long-running operations.

Implementations§

Source§

impl Wait

Source

pub fn new(manual_reset: bool, initial_state: bool) -> Result<Self>

Create a new wait-handle-backed event object.

Source

pub fn named( name: &str, manual_reset: bool, initial_state: bool, ) -> Result<Self>

Create a named wait event for inter-process synchronization.

Source

pub fn manual_reset(initial_state: bool) -> Result<Self>

Create a manual-reset wait handle event.

Source

pub fn auto_reset(initial_state: bool) -> Result<Self>

Create an auto-reset wait handle event.

Source

pub fn raw_handle(&self) -> HANDLE

Return the underlying Win32 handle.

Source

pub fn try_clone(&self) -> Result<Self>

Clone this wait handle with shared internal ownership.

This does not duplicate the underlying OS handle.

Source

pub fn is_signaled(&self) -> Result<bool>

Check if this wait handle is currently signaled without blocking.

Source

pub fn wait(&self) -> Result<()>

Wait indefinitely until this handle is signaled.

Source

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.

Source

pub fn wait_any(handles: &[&Self]) -> Result<usize>

Wait until any handle in handles is signaled.

Returns the index of the signaled handle.

Source

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.

Source

pub fn wait_all(handles: &[&Self]) -> Result<()>

Wait until all handles in handles are signaled.

Source

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.

Source

pub fn set(&self) -> Result<()>

Signal the wait handle.

Source

pub fn reset(&self) -> Result<()>

Reset the wait handle to unsignaled state.

Trait Implementations§

Source§

impl Clone for Wait

Source§

fn clone(&self) -> Wait

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Wait

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Wait

§

impl RefUnwindSafe for Wait

§

impl Send for Wait

§

impl Sync for Wait

§

impl Unpin for Wait

§

impl UnsafeUnpin for Wait

§

impl UnwindSafe for Wait

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.