pub struct Completer<F>where
F: FnOnce(zx_status_t),{ /* private fields */ }
Expand description
Type that wraps a closure for completing an operation.
Calling Completer::reply()
forwards the status to the wrapped closure. Otherwise,
dropping a Completer
indicates failure with a zx::Status::BAD_STATE
status.
Implementations§
Source§impl<F> Completer<F>where
F: FnOnce(zx_status_t),
impl<F> Completer<F>where
F: FnOnce(zx_status_t),
Sourcepub unsafe fn new_unchecked(completer: F) -> Self
pub unsafe fn new_unchecked(completer: F) -> Self
§Safety
Caller promises the provided completer is safe to send to another thread. In some cases, providing a completer that implements Send is difficult. For example, a closure that captures a pointer does not implement Send.
pub fn reply(self, status: Result<(), Status>)
Trait Implementations§
impl<F> Send for Completer<F>where
F: FnOnce(zx_status_t),
Auto Trait Implementations§
impl<F> Freeze for Completer<F>where
F: Freeze,
impl<F> RefUnwindSafe for Completer<F>where
F: RefUnwindSafe,
impl<F> Sync for Completer<F>where
F: Sync,
impl<F> Unpin for Completer<F>where
F: Unpin,
impl<F> UnwindSafe for Completer<F>where
F: UnwindSafe,
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