wait_utils/wait_strategies/wait_until_timeout.rs
1/*
2 * SPDX-License-Identifier: MIT
3 * Copyright (c) "2025" . The buildutils Authors and Contributors. All Rights Reserved.
4 */
5
6use crate::WaitStrategyError;
7use std::thread::sleep;
8use std::time::Duration;
9
10/// Waits for the given duration asynchronously.
11///
12/// # Arguments
13///
14/// * `wait_duration` - The duration to wait for.
15///
16/// # Returns
17///
18/// Returns Ok(()) when the wait is complete.
19///
20pub fn wait_until_timeout(timeout: &u64) -> Result<(), WaitStrategyError> {
21 let timeout = Duration::from_secs(*timeout);
22 sleep(timeout);
23 Ok(())
24}