Trait PeekInterruptSource
pub trait PeekInterruptSource: Send + 'static {
// Required method
fn poll_interrupt(&mut self, cx: &mut Context<'_>) -> Poll<()>;
}Available on crate feature
std only.Expand description
A condition that triggers a PeekInterrupt once it is met.
Sources are polled only while a peek waits for more input,
see PeekInterrupt::attach.
Required Methods§
fn poll_interrupt(&mut self, cx: &mut Context<'_>) -> Poll<()>
fn poll_interrupt(&mut self, cx: &mut Context<'_>) -> Poll<()>
Poll whether the condition is met.
Once this returns Poll::Ready the interrupt stays triggered
and the source is not polled again.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".