pub struct Singleflight<T> { /* private fields */ }Expand description
Singleflight prevents the “Cache Stampede” effect (Dogpile effect). If multiple requests for the same key arrive simultaneously, only the first one executes the future. The others wait and receive the result of the first one.
Implementations§
Trait Implementations§
Source§impl<T: Clone> Clone for Singleflight<T>
impl<T: Clone> Clone for Singleflight<T>
Source§fn clone(&self) -> Singleflight<T>
fn clone(&self) -> Singleflight<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> !RefUnwindSafe for Singleflight<T>
impl<T> !UnwindSafe for Singleflight<T>
impl<T> Freeze for Singleflight<T>
impl<T> Send for Singleflight<T>
impl<T> Sync for Singleflight<T>
impl<T> Unpin for Singleflight<T>
impl<T> UnsafeUnpin for Singleflight<T>
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