pub trait Queue {
// Required methods
fn next(&mut self) -> Result<Option<Unit>, LoopError>;
fn close(
&mut self,
unit: &Unit,
evidence: &Evidence,
) -> Result<CloseOutcome, LoopError>;
}Expand description
Source of work units. Each call to next either returns the next unit to
dispatch or None to signal that the walk is complete.
§Why &mut self (F8 rationale)
A Queue can carry real cursor state. Using &self would force pointless
Mutex-wrapping for state that is inherently sequential in the
single-threaded walk loop. No threading requirement exists at this seam:
run_loop is always called from a single thread. &mut self is the natural
fit and avoids unnecessary interior-mutability noise.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".