pub struct MailboxOwner<U> { /* private fields */ }Expand description
Affine authority over user-message admission for an actor mailbox.
Unlike UserSender, this capability is deliberately not cloneable and
does not expose a counting sender. Cloneable addresses are obtained as
MailboxRefs instead. Consuming this owner with
MailboxOwner::close_admission prevents every stale reference from
acquiring a new delivery permit while allowing permits acquired before
the close to finish. The consumer can then receive every accepted message
followed by Received::UserLaneClosed.
Dropping the owner has the same admission-closing effect. The explicit method is preferred at graceful-retirement sites because it documents the lifecycle transition.
Implementations§
Source§impl<U> MailboxOwner<U>
impl<U> MailboxOwner<U>
Sourcepub fn actor_ref(&self) -> MailboxRef<U>
pub fn actor_ref(&self) -> MailboxRef<U>
Create another non-owning, cloneable address for this mailbox.
Sourcepub fn close_admission(self)
pub fn close_admission(self)
Atomically close admission with respect to deliveries through every
MailboxRef, including stale clones.
A racing delivery has exactly one of two outcomes: it acquired a temporary sender before this close and must be received before the terminal marker, or it receives its original payload back as closed. This operation does not destroy the consumer or discard queued work.