Expand description
A crate that offers a way to create a timeout that can be reset and shared. Additionally, stream timeout is offered under a feature flag.
§Feature flags:
Wrapper
wrapper- enable a wrapper around types that you can use for easier resetting. By default, only future support is enabled (reset the timer upon future completion).read-write- enable asyncRead/Writetrait support for the wrapper (reset the timer upon successful read/write operations)stream- enableStreamsupport for the wrapper (reset the timer upon stream advancement).
Integration with other runtimes
std(enabled by default) - enablestdintegration. Currently it’s only used to enableArcandAsRawFdsupport for the wrapper.tokio(enabled by default) -tokiosupportasync-io- supportasync-ioas the timer runtime.futures-io- supportfutures-iotraits.async-std-async-stdsupport (enablesasync-ioandfutures-io).
See struct documentation for examples.
Modules§
- runtime
- Traits needed for runtime-agnostic time measurement and sleeping
Structs§
- Timeout
- A shared timeout.
- Wrapper
wrapper - A wrapper that wraps a future, a stream or an async reader/writer and resets the timeout upon a new event.
Type Aliases§
- Tokio
Timeout tokio - An alias for
Timeoutusing the tokio runtime - Tokio
Wrapper wrapperandtokio - An alias for
Wrapperusing the tokio runtime