Struct crossbeam_channel::flavors::tick::Channel
source · pub(crate) struct Channel {
delivery_time: AtomicCell<Instant>,
duration: Duration,
}
Expand description
Channel that delivers messages periodically.
Fields§
§delivery_time: AtomicCell<Instant>
The instant at which the next message will be delivered.
duration: Duration
The time interval in which messages get delivered.
Implementations§
source§impl Channel
impl Channel
sourcepub(crate) fn new(delivery_time: Instant, dur: Duration) -> Self
pub(crate) fn new(delivery_time: Instant, dur: Duration) -> Self
Creates a channel that delivers messages periodically.
sourcepub(crate) fn try_recv(&self) -> Result<Instant, TryRecvError>
pub(crate) fn try_recv(&self) -> Result<Instant, TryRecvError>
Attempts to receive a message without blocking.
sourcepub(crate) fn recv(
&self,
deadline: Option<Instant>
) -> Result<Instant, RecvTimeoutError>
pub(crate) fn recv( &self, deadline: Option<Instant> ) -> Result<Instant, RecvTimeoutError>
Receives a message from the channel.
Trait Implementations§
source§impl SelectHandle for Channel
impl SelectHandle for Channel
source§fn 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.source§fn 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.source§fn unregister(&self, _oper: Operation)
fn unregister(&self, _oper: Operation)
Unregisters an operation for execution.
source§fn 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.