pub struct Deferred(/* private fields */);Expand description
A deferred decision: an owned, 'static future that produces the real
NotifAction off the supervisor’s notification loop.
A handler returns NotifAction::Defer when computing the response is
slow (a network round-trip, a blocking syscall) and must not stall the
single supervisor task that gates every other trapped syscall. The
supervisor moves the future onto a worker, lets the loop proceed, and
sends the response (via the still-valid notif.id) when the future
resolves. The future is 'static because it outlives the borrowed
HandlerCtx — capture what you need (notif is Copy, notif_fd is a
RawFd) by value rather than borrowing &self.
The deferred future need only be Send (not Sync): the supervisor
moves it onto a worker task and never shares it by reference. Requiring
Sync of user futures would be a leaky bound (it would reject a future
capturing, say, a Cell), so it is not required.