pub async fn timeout_with<T, E, F>(
kind: TimeoutKind,
duration: Duration,
fut: F,
) -> Result<T, Error>Expand description
Run fut under a tokio timeout and translate the elapsed case into
a named TimeoutKind. Replaces the previous From<Elapsed> impl
so every call site spells out which stage owns the timeout.
§Errors
On expiry returns Error::timeout; otherwise propagates
fut’s own Result.