pub struct Handle {
fd: c_int,
}
Expand description
Device handle for low-level access.
Acquiring a handle facilitates (possibly mutating) interactions with the device.
Fields§
§fd: c_int
Implementations§
source§impl Handle
impl Handle
fn new(fd: c_int) -> Self
sourcepub fn poll(&self, events: i16, timeout: i32) -> Result<i32>
pub fn poll(&self, events: i16, timeout: i32) -> Result<i32>
Polls the file descriptor for I/O events
§Arguments
-
events
- The events you are interested in (e.g. POLLIN) -
timeout
- Timeout in milliseconds A value of zero returns immedately, even if the fd is not ready. A negative value means infinite timeout (blocking).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more