pub trait PollWith<'a, E: ?Sized, EMut: ?Sized>: PollStrategy {
type Progress;
// Required method
fn poll_progress(
state: Pin<&mut Self::Pollable>,
ext: &'a E,
ext_mut: &mut EMut,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<Option<Self::Progress>, Self::Progress>>;
}Expand description
Determines how the Selector polls the tasks and interprets their outputs.
Required Associated Types§
Required Methods§
Sourcefn poll_progress(
state: Pin<&mut Self::Pollable>,
ext: &'a E,
ext_mut: &mut EMut,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<Option<Self::Progress>, Self::Progress>>
fn poll_progress( state: Pin<&mut Self::Pollable>, ext: &'a E, ext_mut: &mut EMut, cx: &mut Context<'_>, ) -> Poll<ControlFlow<Option<Self::Progress>, Self::Progress>>
Polls the given task, providing references to strongly typed extensions.
§Extensions
This method supports passing references to immutable and immutable extensions that can be used by the task. This allows the tasks for operating on a shared state without any unsafe code or synchronization primitives. Even more, extensions allow for static polymorphism in the types returned by the task. See relevant example.
§Returns
ControlFlow::Continueif the task has not finished and might yield more valuesControlFlow::Breakif the task has finished
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".