data Unavailable
The callee cannot be reached or refuses work right now (refused, reset, no replica, overload). retryAfter is the hint of @ratelimit. One of the alternatives of NetError.
Example:
fn wait_hint(e: Unavailable) -> Duration => e.retryAfter ?? 1s
fn main() io {
print("{wait_hint(Unavailable{ retryAfter: 5s }).seconds()} {wait_hint(Unavailable{}).seconds()}")
}Вывод
5 1
@error pub(api) data UnavailableС версии. 1.0.0-beta
Поля
pub(api) retryAfter: Duration? = none | Hint of |
Определено в: std/core/types.oxl:1310