MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / timeout

Method timeout

src/future/future_ext.rs:38–44  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Callers 1

http_timeoutFunction · 0.80

Implementers 1

future_ext.rssrc/future/future_ext.rs

Calls 1

into_futureMethod · 0.45

Tested by

no test coverage detected