• Home
  • Raw
  • Download

Lines Matching full:timeout

3 //! See [`Timeout`] documentation for more details.
5 //! [`Timeout`]: struct@Timeout
22 /// Cancelling a timeout is done by dropping the future. No additional cleanup
25 /// The original future may be obtained by calling [`Timeout::into_inner`]. This
26 /// consumes the `Timeout`.
30 /// Create a new `Timeout` set to expire in 10 milliseconds.
33 /// use tokio::time::timeout;
42 /// // Wrap the future with a `Timeout` set to expire in 10 milliseconds.
43 /// if let Err(_) = timeout(Duration::from_millis(10), rx).await {
48 pub fn timeout<T>(duration: Duration, future: T) -> Timeout<T> in timeout() function
57 Timeout::new_with_delay(future, delay) in timeout()
67 /// Cancelling a timeout is done by dropping the future. No additional cleanup
70 /// The original future may be obtained by calling [`Timeout::into_inner`]. This
71 /// consumes the `Timeout`.
75 /// Create a new `Timeout` set to expire in 10 milliseconds.
87 /// // Wrap the future with a `Timeout` set to expire 10 milliseconds into the
94 pub fn timeout_at<T>(deadline: Instant, future: T) -> Timeout<T> in timeout_at()
100 Timeout { in timeout_at()
107 /// Future returned by [`timeout`](timeout) and [`timeout_at`](timeout_at).
110 pub struct Timeout<T> {
118 impl<T> Timeout<T> { implementation
119 pub(crate) fn new_with_delay(value: T, delay: Sleep) -> Timeout<T> { in new_with_delay()
120 Timeout { value, delay } in new_with_delay()
123 /// Gets a reference to the underlying value in this timeout.
128 /// Gets a mutable reference to the underlying value in this timeout.
133 /// Consumes this timeout, returning the underlying value.
139 impl<T> Future for Timeout<T> implementation