pub trait Driver:
'static
+ Send
+ Sync {
// Required methods
fn new_dyn_timer(&self) -> PollImpl<dyn PollTimer>;
fn new_dyn_socket_ready(
&self,
socket: RawSocket,
) -> Result<PollImpl<dyn PollSocketReady>>;
fn new_dyn_wait(&self, handle: RawHandle) -> Result<PollImpl<dyn PollWait>>;
unsafe fn new_dyn_overlapped_file(
&self,
handle: RawHandle,
) -> Result<PollImpl<dyn IoOverlapped>>;
}
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_socket_ready(
&self,
socket: RawSocket,
) -> Result<PollImpl<dyn PollSocketReady>>
fn new_dyn_socket_ready( &self, socket: RawSocket, ) -> Result<PollImpl<dyn PollSocketReady>>
Creates a new object for polling socket readiness.
Sourcefn new_dyn_wait(&self, handle: RawHandle) -> Result<PollImpl<dyn PollWait>>
fn new_dyn_wait(&self, handle: RawHandle) -> Result<PollImpl<dyn PollWait>>
Creates a new wait.
Sourceunsafe fn new_dyn_overlapped_file(
&self,
handle: RawHandle,
) -> Result<PollImpl<dyn IoOverlapped>>
unsafe fn new_dyn_overlapped_file( &self, handle: RawHandle, ) -> Result<PollImpl<dyn IoOverlapped>>
Creates a new overlapped file handler.
§Safety
The caller must ensure that they exclusively own handle
, and that
handle
stays alive until the new handler is dropped.
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_socket_ready(
&self,
socket: RawSocket,
) -> Result<PollImpl<dyn PollSocketReady>>
fn new_dyn_socket_ready( &self, socket: RawSocket, ) -> Result<PollImpl<dyn PollSocketReady>>
Creates a new object for polling socket readiness.
Source§fn new_dyn_wait(&self, handle: RawHandle) -> Result<PollImpl<dyn PollWait>>
fn new_dyn_wait(&self, handle: RawHandle) -> Result<PollImpl<dyn PollWait>>
Creates a new wait.
Source§unsafe fn new_dyn_overlapped_file(
&self,
handle: RawHandle,
) -> Result<PollImpl<dyn IoOverlapped>>
unsafe fn new_dyn_overlapped_file( &self, handle: RawHandle, ) -> Result<PollImpl<dyn IoOverlapped>>
Creates a new overlapped file handler. Read more