Senders و Receivers
کانالهای Rust دارای دو بخش هستند: Sender<T>
و Receiver<T>
. این دو بخش از طریق channel به هم متصل میشوند، اما شما فقط نقاط پایانی (end-points) را میبینید.
Speaker Notes
This slide should take about 9 minutes.
mpsc
stands for Multi-Producer, Single-Consumer.Sender
andSyncSender
implementClone
(so you can make multiple producers) butReceiver
does not.send()
andrecv()
returnResult
. If they returnErr
, it means the counterpartSender
orReceiver
is dropped and the channel is closed.