Return an error if a future does not complete within a given time span. Typically timeouts are, as the name implies, based on _time_. However this method can time out based on any future. This can be useful in combination with channels, as it allows (long-lived) futures to be cancelled based on some external event. When a timeout is returned, the future will be dropped and destructors will be ru
(self, deadline: D)
| 36 | /// } |
| 37 | /// ``` |
| 38 | fn timeout<D>(self, deadline: D) -> Timeout<Self, D::IntoFuture> |
| 39 | where |
| 40 | Self: Sized, |
| 41 | D: IntoFuture, |
| 42 | { |
| 43 | Timeout::new(self, deadline.into_future()) |
| 44 | } |
| 45 | |
| 46 | /// Delay resolving the future until the given deadline. |
| 47 | /// |
no test coverage detected