Skip to main content

CompletionEvent

Struct CompletionEvent 

Source
pub struct CompletionEvent(/* private fields */);
Expand description

The ring’s completion event, duplicated for the one that waits on it: the notification the Windows backend hands out. A type of this crate and not a bare OwnedHandle, because Waitable is the portable crate’s trait and a handle is the standard library’s, so neither side could implement one for the other.

One is only made from the ring’s own event, by this crate; no safe constructor takes an arbitrary handle, which could be a mutex the wait would acquire and never release:

ⓘ
use std::os::windows::io::OwnedHandle;
use win_durable_ioring::windows_backend::CompletionEvent;

fn any_handle(handle: OwnedHandle) -> CompletionEvent {
    CompletionEvent::new(handle)
}

Implementations§

Source§

impl CompletionEvent

Source

pub fn into_handle(self) -> OwnedHandle

The handle, to wait on by other means.

Trait Implementations§

Source§

impl AsHandle for CompletionEvent

Source§

fn as_handle(&self) -> BorrowedHandle<'_>

Borrows the handle. Read more
Source§

impl Debug for CompletionEvent

Source§

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

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

impl Waitable for CompletionEvent

The ring’s completion event is auto-reset (the ring crate’s D-21), so a wait that sees it signalled consumes the signal, and a raising before the first wait is seen by it: the ring crate signals the event once as it attaches it (its D-20).

One waiter per ring is the caller’s to keep, as the ring crate states it: a second wait on the same event, or a duplicate of this handle waited on elsewhere, steals wakes.

Source§

fn wait(&mut self, timeout: Option<Duration>) -> Result<bool>

Wait for the notification to have been raised since the last wait that saw it, for up to timeout – None is no limit and Duration::ZERO only asks. Whether it was. Read more

Auto Trait Implementations§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.