Trait crossbeam_channel::select::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§
sourcefn try_select(&self, token: &mut Token) -> bool
fn try_select(&self, token: &mut Token) -> bool
Attempts to select an operation and returns true
on success.
sourcefn register(&self, oper: Operation, cx: &Context) -> bool
fn register(&self, oper: Operation, cx: &Context) -> bool
Registers an operation for execution and returns true
if it is now ready.
sourcefn unregister(&self, oper: Operation)
fn unregister(&self, oper: Operation)
Unregisters an operation for execution.
sourcefn accept(&self, token: &mut Token, cx: &Context) -> bool
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.