pub trait SelectHandle {
    // Required methods
    fn try_select(&self, token: &mut Token) -> bool;
    fn deadline(&self) -> Option<Instant>;
    fn register(&self, oper: Operation, cx: &Context) -> bool;
    fn unregister(&self, oper: Operation);
    fn accept(&self, token: &mut Token, cx: &Context) -> bool;
    fn is_ready(&self) -> bool;
    fn watch(&self, oper: Operation, cx: &Context) -> bool;
    fn unwatch(&self, oper: Operation);
}
Expand description

A receiver or a sender that can participate in select.

This is a handle that assists select in executing an operation, registration, deciding on the appropriate deadline for blocking, etc.

Required Methods§

source

fn try_select(&self, token: &mut Token) -> bool

Attempts to select an operation and returns true on success.

source

fn deadline(&self) -> Option<Instant>

Returns a deadline for an operation, if there is one.

source

fn register(&self, oper: Operation, cx: &Context) -> bool

Registers an operation for execution and returns true if it is now ready.

source

fn unregister(&self, oper: Operation)

Unregisters an operation for execution.

source

fn accept(&self, token: &mut Token, cx: &Context) -> bool

Attempts to select an operation the thread got woken up for and returns true on success.

source

fn is_ready(&self) -> bool

Returns true if an operation can be executed without blocking.

source

fn watch(&self, oper: Operation, cx: &Context) -> bool

Registers an operation for readiness notification and returns true if it is now ready.

source

fn unwatch(&self, oper: Operation)

Unregisters an operation for readiness notification.

Implementations on Foreign Types§

source§

impl<T: SelectHandle> SelectHandle for &T

source§

fn try_select(&self, token: &mut Token) -> bool

source§

fn deadline(&self) -> Option<Instant>

source§

fn register(&self, oper: Operation, cx: &Context) -> bool

source§

fn unregister(&self, oper: Operation)

source§

fn accept(&self, token: &mut Token, cx: &Context) -> bool

source§

fn is_ready(&self) -> bool

source§

fn watch(&self, oper: Operation, cx: &Context) -> bool

source§

fn unwatch(&self, oper: Operation)

Implementors§

source§

impl SelectHandle for crossbeam_channel::flavors::at::Channel

source§

impl SelectHandle for crossbeam_channel::flavors::tick::Channel

source§

impl<T> SelectHandle for crossbeam_channel::channel::Receiver<T>

source§

impl<T> SelectHandle for crossbeam_channel::channel::Sender<T>

source§

impl<T> SelectHandle for crossbeam_channel::flavors::array::Receiver<'_, T>

source§

impl<T> SelectHandle for crossbeam_channel::flavors::array::Sender<'_, T>

source§

impl<T> SelectHandle for crossbeam_channel::flavors::list::Receiver<'_, T>

source§

impl<T> SelectHandle for crossbeam_channel::flavors::list::Sender<'_, T>

source§

impl<T> SelectHandle for crossbeam_channel::flavors::never::Channel<T>

source§

impl<T> SelectHandle for crossbeam_channel::flavors::zero::Receiver<'_, T>

source§

impl<T> SelectHandle for crossbeam_channel::flavors::zero::Sender<'_, T>