pub struct HostAwaitCompleter { /* private fields */ }Expand description
Host-side async completion channel (one-shot).
Prefer calling Self::complete / Self::fail explicitly. If the
completer is dropped unused, the flow is failed closed (avoids a
permanent wait when the host forgets to settle the await).
Holds a Weak to the runtime shared state so a bridge that retains
completers cannot keep the runtime alive in a reference cycle
(Shared → bridge → completer → Shared).
Implementations§
Source§impl HostAwaitCompleter
impl HostAwaitCompleter
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
true after finalize, kill, or shutdown cancelled this operation.
Cooperative: the host observes this or HostAwaitBridge::cancel and
aborts the I/O it owns. The flag alone does not close a socket.
Sourcepub fn complete(self, value: Value) -> Result<(), HostAwaitError>
pub fn complete(self, value: Value) -> Result<(), HostAwaitError>
Deliver value as a crate::TAG_SYS_AWAIT hop to the awaiting flow.
Trait Implementations§
Source§impl Drop for HostAwaitCompleter
impl Drop for HostAwaitCompleter
Auto Trait Implementations§
impl !Freeze for HostAwaitCompleter
impl !RefUnwindSafe for HostAwaitCompleter
impl !UnwindSafe for HostAwaitCompleter
impl Send for HostAwaitCompleter
impl Sync for HostAwaitCompleter
impl Unpin for HostAwaitCompleter
impl UnsafeUnpin for HostAwaitCompleter
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