pub struct Sender<T, Codec = Json>(/* private fields */);Expand description
Sends a value to the associated receiver.
Implementations§
Source§impl<T, Codec> Sender<T, Codec>where
T: RemoteSend,
Codec: Codec,
impl<T, Codec> Sender<T, Codec>where
T: RemoteSend,
Codec: Codec,
Sourcepub async fn closed(&self)
pub async fn closed(&self)
Completes when the receiver has been closed, dropped or the connection failed.
Use closed_reason to obtain the cause for closure.
Sourcepub fn closed_reason(&self) -> Option<ClosedReason>
pub fn closed_reason(&self) -> Option<ClosedReason>
Returns the reason for why the channel has been closed.
Returns None if the channel is not closed.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Returns whether the receiver has been closed, dropped or the connection failed.
Use closed_reason to obtain the cause for closure.
Sourcepub fn max_item_size(&self) -> usize
pub fn max_item_size(&self) -> usize
The maximum allowed item size in bytes.
Sourcepub fn set_max_item_size(&mut self, max_item_size: usize)
pub fn set_max_item_size(&mut self, max_item_size: usize)
Sets the maximum allowed item size in bytes.
Trait Implementations§
Source§impl<'de, T, Codec> Deserialize<'de> for Sender<T, Codec>where
T: RemoteSend,
Codec: Codec,
impl<'de, T, Codec> Deserialize<'de> for Sender<T, Codec>where
T: RemoteSend,
Codec: Codec,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Sender<T, Codec>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Sender<T, Codec>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, Codec> Serialize for Sender<T, Codec>where
T: RemoteSend,
Codec: Codec,
impl<T, Codec> Serialize for Sender<T, Codec>where
T: RemoteSend,
Codec: Codec,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<T, Codec> Freeze for Sender<T, Codec>
impl<T, Codec> RefUnwindSafe for Sender<T, Codec>where
Codec: RefUnwindSafe,
impl<T, Codec> Send for Sender<T, Codec>
impl<T, Codec> Sync for Sender<T, Codec>
impl<T, Codec> Unpin for Sender<T, Codec>where
Codec: Unpin,
impl<T, Codec> UnwindSafe for Sender<T, Codec>where
Codec: UnwindSafe,
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