pub struct PricingCache { /* private fields */ }Expand description
Thread-safe handle to the current pricing database.
Implementations§
Source§impl PricingCache
impl PricingCache
pub fn new() -> Self
pub async fn snapshot(&self) -> PricingState
Sourcepub fn spawn_refresher(self) -> Self
pub fn spawn_refresher(self) -> Self
Spawn a background task that does the initial fetch and then refreshes on a timer. Returns a clone of the cache for the caller to retain.
Trait Implementations§
Source§impl Clone for PricingCache
impl Clone for PricingCache
Auto Trait Implementations§
impl !RefUnwindSafe for PricingCache
impl !UnwindSafe for PricingCache
impl Freeze for PricingCache
impl Send for PricingCache
impl Sync for PricingCache
impl Unpin for PricingCache
impl UnsafeUnpin for PricingCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more