aboutsummaryrefslogtreecommitdiff
path: root/embassy-time/src
diff options
context:
space:
mode:
authorCaleb Jamison <[email protected]>2024-01-31 16:26:11 -0500
committerCaleb Jamison <[email protected]>2024-01-31 16:26:11 -0500
commit8b7d85619537fc20ad7ad533433d84ba4975ddc4 (patch)
tree9ec05b932f1bcfb9d4d4f768654637320bb87b44 /embassy-time/src
parent1e698af05bc6e7e520d3f35ef661f34ea6ea359e (diff)
Rename timeout_at to with_deadline
Diffstat (limited to 'embassy-time/src')
-rw-r--r--embassy-time/src/lib.rs2
-rw-r--r--embassy-time/src/timer.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/embassy-time/src/lib.rs b/embassy-time/src/lib.rs
index e7efce49c..3c8575ee9 100644
--- a/embassy-time/src/lib.rs
+++ b/embassy-time/src/lib.rs
@@ -32,7 +32,7 @@ pub use delay::{block_for, Delay};
32pub use duration::Duration; 32pub use duration::Duration;
33pub use embassy_time_driver::TICK_HZ; 33pub use embassy_time_driver::TICK_HZ;
34pub use instant::Instant; 34pub use instant::Instant;
35pub use timer::{timeout_at, with_timeout, Ticker, TimeoutError, Timer}; 35pub use timer::{with_deadline, with_timeout, Ticker, TimeoutError, Timer};
36 36
37const fn gcd(a: u64, b: u64) -> u64 { 37const fn gcd(a: u64, b: u64) -> u64 {
38 if b == 0 { 38 if b == 0 {
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.
33pub async fn timeout_at<F: Future>(at: Instant, fut: F) -> Result<F::Output, TimeoutError> { 33pub 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 {