Trait pal_async::driver::Driver

source ·
pub trait Driver:
    'static
    + Send
    + Sync {
    // Required methods
    fn new_dyn_timer(&self) -> PollImpl<dyn PollTimer>;
    fn new_dyn_fd_ready(&self, fd: RawFd) -> Result<PollImpl<dyn PollFdReady>>;
    fn new_dyn_socket_ready(
        &self,
        socket: RawFd,
    ) -> Result<PollImpl<dyn PollSocketReady>>;
    fn new_dyn_wait(
        &self,
        fd: RawFd,
        read_size: usize,
    ) -> Result<PollImpl<dyn PollWait>>;
}
Expand description

A driver that supports polled IO.

Required Methods§

source

fn new_dyn_timer(&self) -> PollImpl<dyn PollTimer>

Returns a new timer.

source

fn new_dyn_fd_ready(&self, fd: RawFd) -> Result<PollImpl<dyn PollFdReady>>

Returns a new object for polling file descriptor readiness.

source

fn new_dyn_socket_ready( &self, socket: RawFd, ) -> Result<PollImpl<dyn PollSocketReady>>

Creates a new object for polling socket readiness.

source

fn new_dyn_wait( &self, fd: RawFd, read_size: usize, ) -> Result<PollImpl<dyn PollWait>>

Creates a new wait.

Signals will be consumed using reads of read_size bytes, with 8-byte buffer alignment. read_size must be at most MAXIMUM_WAIT_READ_SIZE bytes.

Trait Implementations§

source§

impl Driver for Box<dyn Driver>

source§

fn new_dyn_timer(&self) -> PollImpl<dyn PollTimer>

Returns a new timer.
source§

fn new_dyn_fd_ready(&self, fd: RawFd) -> Result<PollImpl<dyn PollFdReady>>

Returns a new object for polling file descriptor readiness.
source§

fn new_dyn_socket_ready( &self, socket: RawFd, ) -> Result<PollImpl<dyn PollSocketReady>>

Creates a new object for polling socket readiness.
source§

fn new_dyn_wait( &self, fd: RawFd, read_size: usize, ) -> Result<PollImpl<dyn PollWait>>

Creates a new wait. Read more

Implementations on Foreign Types§

source§

impl Driver for Box<dyn Driver>

source§

impl Driver for Arc<dyn Driver>

Implementors§

source§

impl<T> Driver for T