qubit_lock/monitor/timeout_notification_waiter.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Blocking timeout notification-wait capability.
11
12use std::time::Duration;
13
14use crate::monitor::WaitTimeoutStatus;
15
16/// Waits for a notification with a relative timeout.
17pub trait TimeoutNotificationWaiter {
18 /// Blocks until a notification is observed or the timeout expires.
19 ///
20 /// # Arguments
21 ///
22 /// * `timeout` - Maximum relative duration to wait.
23 ///
24 /// # Returns
25 ///
26 /// A status describing whether the wait returned before the timeout.
27 fn wait_for(&self, timeout: Duration) -> WaitTimeoutStatus;
28}