Trait timeout_io::WaitForEvent [−][src]
pub trait WaitForEvent { fn wait_until_readable(&self, timeout: Duration) -> Result<()>; fn wait_until_writeable(&self, timeout: Duration) -> Result<()>; fn set_blocking_mode(&self, blocking: bool) -> Result<()>; }
This trait defines an API to wait for an event
Required Methods
fn wait_until_readable(&self, timeout: Duration) -> Result<()>
Waits until self
is ready for reading or timeout
was reached
Parameters:
timeout
: The maximum time this function will wait forself
to become readable
Returns either nothing or a corresponding IoError
fn wait_until_writeable(&self, timeout: Duration) -> Result<()>
Waits until self
is ready for writing or timeout
was reached
Parameters:
timeout
: The maximum time this function will wait forself
to become writeable
Returns either nothing or a corresponding IoError
fn set_blocking_mode(&self, blocking: bool) -> Result<()>
Makes self
blocking or non-blocking
Parameters:
blocking
: Set totrue
if you want to make the socket blocking,false
otherwise
Returns either nothing or a corresponding IoError
Implementors
impl<T: RawFd> WaitForEvent for T