pub struct PageSender { /* private fields */ }Expand description
Sender half for page → target communication.
Wraps a bounded mpsc::Sender<TargetMessage> and, when running under
Handler::run(), an Arc<Notify> that wakes the handler’s
tokio::select! loop after every successful send.
Implementations§
Source§impl PageSender
impl PageSender
Sourcepub fn new(inner: Sender<TargetMessage>, wake: Option<Arc<Notify>>) -> Self
pub fn new(inner: Sender<TargetMessage>, wake: Option<Arc<Notify>>) -> Self
Create a new PageSender.
Pass None for wake when using the Stream-based handler
(no notification overhead). Pass Some(notify) when using
Handler::run().
Sourcepub fn try_send(
&self,
msg: TargetMessage,
) -> Result<(), TrySendError<TargetMessage>>
pub fn try_send( &self, msg: TargetMessage, ) -> Result<(), TrySendError<TargetMessage>>
Non-blocking send. Notifies the handler on success.
Sourcepub async fn send(
&self,
msg: TargetMessage,
) -> Result<(), SendError<TargetMessage>>
pub async fn send( &self, msg: TargetMessage, ) -> Result<(), SendError<TargetMessage>>
Async send (waits for capacity). Notifies the handler on success.
Trait Implementations§
Source§impl Clone for PageSender
impl Clone for PageSender
Source§fn clone(&self) -> PageSender
fn clone(&self) -> PageSender
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PageSender
impl RefUnwindSafe for PageSender
impl Send for PageSender
impl Sync for PageSender
impl Unpin for PageSender
impl UnsafeUnpin for PageSender
impl UnwindSafe for PageSender
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