pub struct DispatchSender<T> { /* private fields */ }Expand description
A message sender which preserves callback ancestry when bound to a live runtime.
Sends on the runtime owner thread capture its active root. Sends on other threads and sends without an active root are independent ingress. Conversion from a plain Tokio sender supports standalone clients whose receivers consume domain events directly, without callback tracking.
Implementations§
Source§impl<T> DispatchSender<T>
impl<T> DispatchSender<T>
Sourcepub fn new(sender: UnboundedSender<DispatchMessage<T>>) -> Self
pub fn new(sender: UnboundedSender<DispatchMessage<T>>) -> Self
Binds a dispatch channel to the calling runtime thread.
Sourcepub fn send(&self, message: T) -> Result<(), SendError<DispatchMessage<T>>>
pub fn send(&self, message: T) -> Result<(), SendError<DispatchMessage<T>>>
Sourcepub fn same_channel(&self, other: &Self) -> bool
pub fn same_channel(&self, other: &Self) -> bool
Returns whether both senders target the same channel.
Trait Implementations§
Source§impl<T> Clone for DispatchSender<T>
impl<T> Clone for DispatchSender<T>
Source§impl<T: Debug> Debug for DispatchSender<T>
impl<T: Debug> Debug for DispatchSender<T>
Auto Trait Implementations§
impl<T> Freeze for DispatchSender<T>where
DispatchChannel<T>: Freeze,
impl<T> RefUnwindSafe for DispatchSender<T>where
DispatchChannel<T>: RefUnwindSafe,
impl<T> Send for DispatchSender<T>where
DispatchChannel<T>: Send,
impl<T> Sync for DispatchSender<T>where
DispatchChannel<T>: Sync,
impl<T> Unpin for DispatchSender<T>where
DispatchChannel<T>: Unpin,
impl<T> UnsafeUnpin for DispatchSender<T>where
DispatchChannel<T>: UnsafeUnpin,
impl<T> UnwindSafe for DispatchSender<T>where
DispatchChannel<T>: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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