pub struct MailboxRef<U> { /* private fields */ }Expand description
Cloneable, non-owning actor address governed by a MailboxOwner.
Each send acquires exactly one temporary admission permit. Unlike
UserAnchor, this restricted address deliberately does not expose that
permit as a UserSender, so code holding stale references cannot retain
or clone admission beyond an individual delivery operation.
Implementations§
Source§impl<U> MailboxRef<U>
impl<U> MailboxRef<U>
Sourcepub async fn send(&self, item: U) -> Result<(), UserClosed<U>>
pub async fn send(&self, item: U) -> Result<(), UserClosed<U>>
Deliver one message, awaiting bounded-lane capacity.
Returns the original message if admission was already closed or the consumer disappeared before the message was accepted.
Sourcepub fn try_send(&self, item: U) -> Result<(), TrySendError<U>>
pub fn try_send(&self, item: U) -> Result<(), TrySendError<U>>
Try to deliver one message without waiting for capacity.
A close racing this call either follows the accepted message in the receive stream or wins and returns the original message as closed.
Trait Implementations§
Auto Trait Implementations§
impl<U> Freeze for MailboxRef<U>
impl<U> RefUnwindSafe for MailboxRef<U>
impl<U> Send for MailboxRef<U>where
U: Send,
impl<U> Sync for MailboxRef<U>where
U: Send,
impl<U> Unpin for MailboxRef<U>
impl<U> UnsafeUnpin for MailboxRef<U>
impl<U> UnwindSafe for MailboxRef<U>
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