pub struct UserSender<U> { /* private fields */ }Expand description
Cloneable handle to the bounded user lane.
Implementations§
Source§impl<U> UserSender<U>
impl<U> UserSender<U>
Sourcepub async fn send(&self, item: U) -> Result<(), UserClosed<U>>
pub async fn send(&self, item: U) -> Result<(), UserClosed<U>>
Enqueue a user message, awaiting capacity (backpressure).
The send linearizes at the ring-slot publish. If the consumer is dropped while this send is blocked on a full ring, teardown releases it with its payload — a blocked send never reports success for an item that was not enqueued.
§Errors
Returns UserClosed carrying item if the consumer is gone —
including when teardown releases a send blocked on a full ring.
Sourcepub fn try_send(&self, item: U) -> Result<(), TrySendError<U>>
pub fn try_send(&self, item: U) -> Result<(), TrySendError<U>>
Enqueue a user message without blocking.
§Errors
TrySendError::Full if the lane is at capacity, TrySendError::Closed
if the consumer is gone — each carrying item back.
Sourcepub fn anchor(&self) -> UserAnchor<U>
pub fn anchor(&self) -> UserAnchor<U>
Derive a non-owning anchor from this sender (address-table
endpoint). The anchor holds no liveness: the lane closes when the
last counting UserSender drops even while anchors are held.