crossbeam_channel::select

Trait SelectHandle

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

Source§

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

Source§

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