futures_intrusive::sync

Struct GenericManualResetEvent

Source
pub struct GenericManualResetEvent<MutexType: RawMutex> { /* private fields */ }
Expand description

A synchronization primitive which can be either in the set or reset state.

Tasks can wait for the event to get set by obtaining a Future via wait. This Future will get fulfilled when the event has been set.

Implementations§

Source§

impl<MutexType: RawMutex> GenericManualResetEvent<MutexType>

Source

pub fn new(is_set: bool) -> GenericManualResetEvent<MutexType>

Creates a new ManualResetEvent in the given state

Source

pub fn set(&self)

Sets the event.

Setting the event will notify all pending waiters.

Source

pub fn reset(&self)

Resets the event.

Source

pub fn is_set(&self) -> bool

Returns whether the event is set

Source

pub fn wait(&self) -> GenericWaitForEventFuture<'_, MutexType>

Returns a future that gets fulfilled when the event is set.

Trait Implementations§

Source§

impl<MutexType: RawMutex> Debug for GenericManualResetEvent<MutexType>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<MutexType: RawMutex + Send> Send for GenericManualResetEvent<MutexType>

Source§

impl<MutexType: RawMutex + Sync> Sync for GenericManualResetEvent<MutexType>

Auto Trait Implementations§

§

impl<MutexType> !Freeze for GenericManualResetEvent<MutexType>

§

impl<MutexType> !RefUnwindSafe for GenericManualResetEvent<MutexType>

§

impl<MutexType> Unpin for GenericManualResetEvent<MutexType>
where MutexType: Unpin,

§

impl<MutexType> UnwindSafe for GenericManualResetEvent<MutexType>
where MutexType: UnwindSafe,

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> 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, 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.