Struct channel::diem_channel::Sender
source · pub struct Sender<K: Eq + Hash + Clone, M> { /* private fields */ }
Expand description
The sending end of the diem_channel.
Implementations§
source§impl<K: Eq + Hash + Clone, M> Sender<K, M>
impl<K: Eq + Hash + Clone, M> Sender<K, M>
sourcepub fn push(&mut self, key: K, message: M) -> Result<()>
pub fn push(&mut self, key: K, message: M) -> Result<()>
This adds the message into the internal queue data structure. This is a synchronous call.
sourcepub fn push_with_feedback(
&mut self,
key: K,
message: M,
status_ch: Option<Sender<ElementStatus<M>>>
) -> Result<()>
pub fn push_with_feedback( &mut self, key: K, message: M, status_ch: Option<Sender<ElementStatus<M>>> ) -> Result<()>
Same as push
, but this function also accepts a oneshot::Sender over which the sender can
be notified when the message eventually gets delivered or dropped.