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§
sourcefn new_dyn_timer(&self) -> PollImpl<dyn PollTimer>
fn new_dyn_timer(&self) -> PollImpl<dyn PollTimer>
Returns a new timer.
sourcefn new_dyn_fd_ready(&self, fd: RawFd) -> Result<PollImpl<dyn PollFdReady>>
fn new_dyn_fd_ready(&self, fd: RawFd) -> Result<PollImpl<dyn PollFdReady>>
Returns a new object for polling file descriptor readiness.
sourcefn new_dyn_socket_ready(
&self,
socket: RawFd,
) -> Result<PollImpl<dyn PollSocketReady>>
fn new_dyn_socket_ready( &self, socket: RawFd, ) -> Result<PollImpl<dyn PollSocketReady>>
Creates a new object for polling socket readiness.
sourcefn new_dyn_wait(
&self,
fd: RawFd,
read_size: usize,
) -> Result<PollImpl<dyn PollWait>>
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>
impl Driver for Box<dyn Driver>
source§fn new_dyn_timer(&self) -> PollImpl<dyn PollTimer>
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>>
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>>
fn new_dyn_socket_ready( &self, socket: RawFd, ) -> Result<PollImpl<dyn PollSocketReady>>
Creates a new object for polling socket readiness.