Crate async_shared_timeout
source ·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
/Write
trait support for the wrapper (reset the timer upon successful read/write operations)stream
- enableStream
support for the wrapper (reset the timer upon stream advancement).
Integration with other runtimes
std
(enabled by default) - enablestd
integration. Currently it’s only used to enableArc
andAsRawFd
support for the wrapper.tokio
(enabled by default) -tokio
supportasync-io
- supportasync-io
as the timer runtime.futures-io
- supportfutures-io
traits.async-std
-async-std
support (enablesasync-io
andfutures-io
).
See struct documentation for examples.
Modules§
- Traits needed for runtime-agnostic time measurement and sleeping
Structs§
- A shared timeout.
- A wrapper that wraps a future, a stream or an async reader/writer and resets the timeout upon a new event.