pub struct Group<K, T, E, S = RandomState> { /* private fields */ }Expand description
Namespace for duplicate suppression.
For a given key, only the leader computes. Duplicate callers subscribe to
the leader’s broadcast and receive the same Outcome.
Implementations§
Source§impl<K, T, E, S> Group<K, T, E, S>
impl<K, T, E, S> Group<K, T, E, S>
pub fn with_hasher(hasher: S) -> Self
Source§impl<K, T, E, S> Group<K, T, E, S>
impl<K, T, E, S> Group<K, T, E, S>
Sourcepub fn entry(&self, key: K) -> Entry<K, T, E, S>
pub fn entry(&self, key: K) -> Entry<K, T, E, S>
Returns a leader for a new key, or a subscriber for an in-flight key.
Sourcepub async fn run<F, Fut>(&self, key: K, f: F) -> Arc<Outcome<T, E>> ⓘ
pub async fn run<F, Fut>(&self, key: K, f: F) -> Arc<Outcome<T, E>> ⓘ
Executes f once per key while an earlier call is in flight.
pub fn in_flight(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<K, T, E, S> Freeze for Group<K, T, E, S>
impl<K, T, E, S> RefUnwindSafe for Group<K, T, E, S>
impl<K, T, E, S> Send for Group<K, T, E, S>
impl<K, T, E, S> Sync for Group<K, T, E, S>
impl<K, T, E, S> Unpin for Group<K, T, E, S>
impl<K, T, E, S> UnsafeUnpin for Group<K, T, E, S>
impl<K, T, E, S> UnwindSafe for Group<K, T, E, S>
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