pub struct Completion(/* private fields */);Expand description
A lightweight in-process completion event.
Conceptually, a completion has an internal state of either unsignaled or signaled. Threads may wait on the completion until it achieves the signaled state, or alter its state.
On Fuchsia, this wraps sync_completion_t from zircon/system/ulib/sync.
Implementations§
Source§impl Completion
impl Completion
Sourcepub fn wait_for(&self, timeout: Duration) -> bool
pub fn wait_for(&self, timeout: Duration) -> bool
Blocks the current thread until the completion is signaled or the timeout expires.
Returns true if the completion was signaled, or false if it timed out.
Sourcepub fn wait_until(&self, deadline: MonotonicInstant) -> bool
pub fn wait_until(&self, deadline: MonotonicInstant) -> bool
Blocks the current thread until the completion is signaled or the deadline is reached.
Returns true if the completion was signaled, or false if it timed out.
Sourcepub fn is_signaled(&self) -> bool
pub fn is_signaled(&self) -> bool
Returns true if the completion has been signaled.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Completion
impl RefUnwindSafe for Completion
impl Unpin for Completion
impl UnsafeUnpin for Completion
impl UnwindSafe for Completion
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