Trait ThreadEvent

Source
pub trait ThreadEvent: Sync + Default {
    // Required methods
    fn is_set(&self) -> bool;
    fn reset(&self);
    fn wait(&self);
    fn set(&self);
}
Expand description

Abstraction which provides a method of blocking and unblocking threads through the interface of a manual reset event.

Required Methods§

Source

fn is_set(&self) -> bool

Approximately check if the event is set or not.

Source

fn reset(&self)

Reset the event back to an un-signalled state.

Source

fn wait(&self)

Block for the event to become signaled. If the event is already signaled, this returns without blocking.

Source

fn set(&self)

Transition the event to a signaled state, unblocking any threads that were waiting on it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§