Structs§

  • Streams should indicate their termination by returning an item of Poll::Ready(None). Once a Stream terminated it is generally not safe to poll the Stream any longer. Support for safely polling already terminated Streams is provided by the Fuse wrapper. The wrapper only polls not yet terminated Streams. If the underlying Stream already terminated Fuse immediately returns Poll::Ready(None) without further polling its wrapped Stream. Some Streams never terminate, such as FuturesOrdered. To indicate that there is currently no work scheduled, these Streams return Poll::Ready(None). However, when these Streams are used in combination with Fuse the Streams would get polled once and immediately declared to have terminated due to their return value oof Poll::Ready(None). Instead, such Streams should return Poll::Pending. FusePending provides this mapping. Note: This wrapper should only be used if the underlying Stream defined its behavior if no work is scheduled. Usually, such Streams are expected to never terminate.