pub struct WeakSender { /* private fields */ }Expand description
A weak sender handle that can send messages without keeping the channel alive.
Created via RelaySender::weak(). If the RelaySender has been dropped,
send operations will return Err(SendError::Closed).
Implementations§
Source§impl WeakSender
impl WeakSender
Sourcepub async fn send<T: 'static + Send + Sync>(
&self,
value: T,
) -> Result<(), SendError>
pub async fn send<T: 'static + Send + Sync>( &self, value: T, ) -> Result<(), SendError>
Send a typed message if the channel is still open.
Sourcepub async fn send_any(
&self,
value: Arc<dyn Any + Send + Sync>,
type_id: TypeId,
) -> Result<(), SendError>
pub async fn send_any( &self, value: Arc<dyn Any + Send + Sync>, type_id: TypeId, ) -> Result<(), SendError>
Send a type-erased message if the channel is still open.
Trait Implementations§
Source§impl Clone for WeakSender
impl Clone for WeakSender
Source§fn clone(&self) -> WeakSender
fn clone(&self) -> WeakSender
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 WeakSender
impl !RefUnwindSafe for WeakSender
impl Send for WeakSender
impl Sync for WeakSender
impl Unpin for WeakSender
impl !UnwindSafe for WeakSender
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