diff options
| author | Caleb Jamison <[email protected]> | 2024-01-31 16:26:11 -0500 |
|---|---|---|
| committer | Caleb Jamison <[email protected]> | 2024-01-31 16:26:11 -0500 |
| commit | 8b7d85619537fc20ad7ad533433d84ba4975ddc4 (patch) | |
| tree | 9ec05b932f1bcfb9d4d4f768654637320bb87b44 /embassy-time/src/timer.rs | |
| parent | 1e698af05bc6e7e520d3f35ef661f34ea6ea359e (diff) | |
Rename timeout_at to with_deadline
Diffstat (limited to 'embassy-time/src/timer.rs')
| -rw-r--r-- | embassy-time/src/timer.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-time/src/timer.rs b/embassy-time/src/timer.rs index dbce9297c..bcd6bf4f7 100644 --- a/embassy-time/src/timer.rs +++ b/embassy-time/src/timer.rs | |||
| @@ -30,7 +30,7 @@ pub async fn with_timeout<F: Future>(timeout: Duration, fut: F) -> Result<F::Out | |||
| 30 | /// | 30 | /// |
| 31 | /// If the future completes before the deadline, its output is returned. Otherwise, on timeout, | 31 | /// If the future completes before the deadline, its output is returned. Otherwise, on timeout, |
| 32 | /// work on the future is stopped (`poll` is no longer called), the future is dropped and `Err(TimeoutError)` is returned. | 32 | /// work on the future is stopped (`poll` is no longer called), the future is dropped and `Err(TimeoutError)` is returned. |
| 33 | pub async fn timeout_at<F: Future>(at: Instant, fut: F) -> Result<F::Output, TimeoutError> { | 33 | pub async fn with_deadline<F: Future>(at: Instant, fut: F) -> Result<F::Output, TimeoutError> { |
| 34 | let timeout_fut = Timer::at(at); | 34 | let timeout_fut = Timer::at(at); |
| 35 | pin_mut!(fut); | 35 | pin_mut!(fut); |
| 36 | match select(fut, timeout_fut).await { | 36 | match select(fut, timeout_fut).await { |
