From 31a19e3632de8d53b98a12c129affee9f5108f68 Mon Sep 17 00:00:00 2001 From: Zak Stucke Date: Sat, 22 Jun 2024 12:21:20 +0300 Subject: [PATCH] Expose guard --- rust/bitbazaar/misc/refreshable.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/bitbazaar/misc/refreshable.rs b/rust/bitbazaar/misc/refreshable.rs index 5026a78a..6de269c8 100644 --- a/rust/bitbazaar/misc/refreshable.rs +++ b/rust/bitbazaar/misc/refreshable.rs @@ -3,6 +3,8 @@ use std::sync::{atomic::AtomicU64, Arc}; use arc_swap::ArcSwap; use futures::Future; +pub use arc_swap::Guard as RefreshableGuard; + use crate::prelude::*; /// A data wrapper that automatically updates the data given out when deemed stale. @@ -52,7 +54,7 @@ impl>, F: Fn() -> Fut> Refreshable RResult>, AnyErr> { + pub async fn get(&self) -> RResult>, AnyErr> { // Refresh if now stale: if utc_now_ms() - self