pub struct PortEvent { /* private fields */ }
Expand description
A wrapper around a zx::Port
that optimizes for the case where events are
signaled within a process.
This object will prefer to use a Futex for notifications/interrupts but will
fallback to a zx::Port
when the port is subscribed for events on an object
with [PortEvent.object_wait_async
].
Note that the PortEvent
does not provide any synchronization between a
notifier (caller of [PortEvent.notify
]) and a notifiee/waiter (caller of
[PortEvent.wait
].
Implementations§
Source§impl PortEvent
impl PortEvent
Sourcepub fn wait(&self, deadline: MonotonicInstant) -> PortWaitResult
pub fn wait(&self, deadline: MonotonicInstant) -> PortWaitResult
Wait for an event to occur, or the deadline has been reached.
Sourcepub fn object_wait_async(
&self,
handle: &dyn AsHandleRef,
key: u64,
signals: Signals,
opts: WaitAsyncOpts,
) -> Result<(), Status>
pub fn object_wait_async( &self, handle: &dyn AsHandleRef, key: u64, signals: Signals, opts: WaitAsyncOpts, ) -> Result<(), Status>
Subscribe for signals on an object.
Sourcepub fn cancel(&self, handle: &HandleRef<'_>, key: u64)
pub fn cancel(&self, handle: &HandleRef<'_>, key: u64)
Cancels async port notifications on an object.
Sourcepub fn notify(&self, kind: NotifyKind)
pub fn notify(&self, kind: NotifyKind)
Marks the port as ready to handle a notification (or an interrupt) and wakes up any blocked waiters.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PortEvent
impl RefUnwindSafe for PortEvent
impl Send for PortEvent
impl Sync for PortEvent
impl Unpin for PortEvent
impl UnwindSafe for PortEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more