Skip to main content

Module select

Module select 

Source
Expand description

Backend-agnostic racing combinators (replace tokio::select! at the drive-loop sites). Poll-based and unbiased: both futures are polled on every wake; whichever completes first wins.

Futures are taken by value — callers pass &mut of core::pin::pin!(..) bindings (&mut Pin<&mut F> is a Future and is Unpin).

Cancel-safety matches tokio::select!: when the combinator completes on one arm, the other arm’s future is dropped (work on it stops).

Structs§

Select2
Races two futures; see select2.
Select3
Races three futures; see select3.

Enums§

Either
Two-arm race output.
Which3
Three-arm race output.

Functions§

select2
Races two futures.
select3
Races three futures.