Skip to main content

WaitStrategy

Trait WaitStrategy 

Source
pub trait WaitStrategy: Send {
    // Required method
    fn wait(&mut self);

    // Provided method
    fn signal(&self) { ... }
}
Expand description

Strategy for backing off when the ring is full (producer) or empty (consumer). Implementations should be cheap to construct and Sendable to the owning thread.

Required Methods§

Source

fn wait(&mut self)

Wait briefly. Called between retries when the ring isn’t ready.

Provided Methods§

Source

fn signal(&self)

Signal the waiter. Default is a no-op; only ParkStrategy overrides.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§