pub trait Pollable<'a, E: ?Sized, EMut: ?Sized> {
type Progress;
// Required method
fn poll_progress(
self: Pin<&mut Self>,
ext: &'a E,
ext_mut: &mut EMut,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<Option<Self::Progress>, Self::Progress>>;
}Expand description
Task that can be polled inside a Selector.
Required Associated Types§
Required Methods§
Sourcefn poll_progress(
self: Pin<&mut Self>,
ext: &'a E,
ext_mut: &mut EMut,
cx: &mut Context<'_>,
) -> Poll<ControlFlow<Option<Self::Progress>, Self::Progress>>
fn poll_progress( self: Pin<&mut Self>, ext: &'a E, ext_mut: &mut EMut, cx: &mut Context<'_>, ) -> Poll<ControlFlow<Option<Self::Progress>, Self::Progress>>
Polls the given task with references to strongly typed extensions.
§Extensions
This method supports passing references to immutable and mutable 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 dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".