Selectable

Trait Selectable 

Source
pub trait Selectable {
    // Required method
    fn wait_until_ready(
        &self,
        interest: ReadyInterest,
        trapframe: &mut Trapframe,
        timeout_ticks: Option<u64>,
    ) -> SelectWaitOutcome;

    // Provided methods
    fn current_ready(&self, interest: ReadyInterest) -> ReadySet { ... }
    fn set_nonblocking(&self, _enabled: bool) { ... }
    fn is_nonblocking(&self) -> bool { ... }
}
Expand description

Objects that can be waited on by select/pselect.

Required Methods§

Source

fn wait_until_ready( &self, interest: ReadyInterest, trapframe: &mut Trapframe, timeout_ticks: Option<u64>, ) -> SelectWaitOutcome

Block the current task using the provided trapframe until the interest becomes ready or the optional timeout (in ticks) expires.

Return SelectWaitOutcome::TimedOut if the timeout elapsed before readiness, otherwise SelectWaitOutcome::Ready.

Provided Methods§

Source

fn current_ready(&self, interest: ReadyInterest) -> ReadySet

Return current readiness for the given interest set.

Source

fn set_nonblocking(&self, _enabled: bool)

Enable or disable non-blocking I/O semantics on this object.

When enabled, operations that would otherwise block (e.g., reads with no data available, writes to a full buffer) should avoid internal waits and instead report a WouldBlock condition to the caller.

Source

fn is_nonblocking(&self) -> bool

Query whether non-blocking I/O semantics are enabled on this object.

Implementors§