Skip to content

Commit 250649a

Browse files
authored
fix(api): Expose FuturesTimerSleeper properly (#205)
Also fix name inconsistencies.
1 parent 99d6c81 commit 250649a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

backon/src/lib.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
//! environments, they are gated under their own features, which are enabled
4242
//! by default:
4343
//!
44-
//! | `Sleeper` | feature | Environment | Asynchronous |
45-
//! |----------------------|--------------------|-------------|---------------|
46-
//! | [`TokioSleeper`] | tokio-sleep | non-wasm32 | Yes |
47-
//! | [`GlooTimersSleep`] | gloo-timers-sleep | wasm32 | Yes |
48-
//! | [`FutureTimerSleep`] | future-timer-sleep |wasm/non-wasm| Yes |
49-
//! | [`EmbassySleep`] | embassy-sleep | no_std | Yes |
50-
//! | [`StdSleeper`] | std-blocking-sleep | std | No |
44+
//! | `Sleeper` | feature | Environment | Asynchronous |
45+
//! |-------------------------|---------------------|-------------|---------------|
46+
//! | [`TokioSleeper`] | tokio-sleep | non-wasm32 | Yes |
47+
//! | [`GlooTimersSleep`] | gloo-timers-sleep | wasm32 | Yes |
48+
//! | [`FuturesTimerSleeper`] | futures-timer-sleep |wasm/non-wasm| Yes |
49+
//! | [`EmbassySleep`] | embassy-sleep | no_std | Yes |
50+
//! | [`StdSleeper`] | std-blocking-sleep | std | No |
5151
//!
5252
//! ## Custom Sleeper
5353
//!
@@ -227,6 +227,8 @@ pub use retry_with_context::RetryableWithContext;
227227

228228
mod sleep;
229229
pub use sleep::DefaultSleeper;
230+
#[cfg(feature = "futures-timer-sleep")]
231+
pub use sleep::FuturesTimerSleeper;
230232
#[cfg(all(target_arch = "wasm32", feature = "gloo-timers-sleep"))]
231233
pub use sleep::GlooTimersSleep;
232234
pub use sleep::Sleeper;

backon/src/sleep.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ impl Sleeper for TokioSleeper {
8484
/// It is async runtime agnostic and will also work in WASM environments.
8585
#[cfg(feature = "futures-timer-sleep")]
8686
#[derive(Clone, Copy, Debug, Default)]
87-
pub struct FuturesTimerSleep;
87+
pub struct FuturesTimerSleeper;
8888

8989
#[cfg(feature = "futures-timer-sleep")]
90-
impl Sleeper for FuturesTimerSleep {
90+
impl Sleeper for FuturesTimerSleeper {
9191
type Sleep = futures_timer::Delay;
9292

9393
fn sleep(&self, dur: Duration) -> Self::Sleep {

0 commit comments

Comments
 (0)