Skip to main content

Pollable

Trait Pollable 

Source
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§

Source

type Progress

Type of values returned when polling the task.

Required Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<'a, T, P, E, EMut> Pollable<'a, E, EMut> for Selector<T, P>
where P: PollProxy<'a, T, E, EMut>, E: ?Sized, EMut: ?Sized,

Source§

type Progress = <P as PollProxy<'a, T, E, EMut>>::Progress