January 2019
Intermediate to advanced
520 pages
14h 32m
English
Future and Stream objects supply data from a source, but if you want to send a piece of data to the source, you have to use Sink objects. Sink is a trait that is similar to Stream, but works in the opposite direction. It contains two associated types—SinkItem and SinkError. The first determines the type of item that can be sent using a specific sink. The second represents an error if the sending process goes wrong. To interact with a Sink, you should use the methods of the SinkExt trait, which contains send methods to send an item to a recipient. The send method returns a Send struct that implements the Future trait, which means you can't send an item immediately. The call of the send methods returns a future ...
Read now
Unlock full access