pub trait AsyncDuplexSetup {
    type ReadError: PartialEq;
    type WriteError: PartialEq;

    const READ_WOULD_BLOCK: Self::ReadError;
    const WRITE_WOULD_BLOCK: Self::WriteError;

    // Required methods
    fn setup_read_sleep(&self) -> ThreadSyncSleep;
    fn setup_write_sleep(&self) -> ThreadSyncSleep;
}
Expand description

Implement setting up externally signaled asynchronous events for the async runner to wait for, in the case where there is a duplex mode for reading and writing to this object, each of which could fail with some “would block” error.

Required Associated Types§

source

type ReadError: PartialEq

The error type returned by read operations.

source

type WriteError: PartialEq

The error type returned by write operations.

Required Associated Constants§

source

const READ_WOULD_BLOCK: Self::ReadError

The specific variant of the error type that indicates that a read operation would block.

source

const WRITE_WOULD_BLOCK: Self::WriteError

The specific variant of the error type that indicates that a write operation would block.

Required Methods§

source

fn setup_read_sleep(&self) -> ThreadSyncSleep

Return a thread sync sleep operation specification for reading from this handle.

source

fn setup_write_sleep(&self) -> ThreadSyncSleep

Return a thread sync sleep operation specification for writing to this handle.

Implementors§