pub fn wait_deadline(timeout: Duration) -> Option<Instant>Expand description
The absolute deadline a wait(timeout) poll loop should honour, or None for
the SyncWaiter::wait contract’s Duration::MAX “wait forever” sentinel.
timeout == Duration::MAX→None: the caller asked to wait forever, so the loop runs with no deadline (matching every backend’s explicitDuration::MAXhandling, which maps to the native “infinite”:vkWaitSemaphores(UINT64_MAX),WaitForSingleObject(INFINITE),cuEventSynchronize, …).- any other
timeout→Some(now + timeout), saturated to a bounded, always-representableInstantonInstant + Durationoverflow — clamped tonow + 1 year, far beyond any real GPU wait budget.
This keeps the two meanings of “no deadline” distinct: a returned None
encodes ONLY the explicit forever sentinel, never an accidental checked_add
overflow — which would otherwise silently convert a bounded wait into an
unbounded hang.