diff --git a/src/wpactrl.rs b/src/wpactrl.rs index b739aa9..f79fff2 100644 --- a/src/wpactrl.rs +++ b/src/wpactrl.rs @@ -178,6 +178,12 @@ impl ClientInternal { } } +impl AsRawFd for ClientInternal { + fn as_raw_fd(&self) -> RawFd { + self.handle.as_raw_fd() + } +} + impl Drop for ClientInternal { fn drop(&mut self) { if let Err(e) = std::fs::remove_file(&self.filepath) { @@ -248,6 +254,12 @@ impl Client { } } +impl AsRawFd for Client { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + /// A connection to `wpa_supplicant` / `hostapd` that receives status messages pub struct ClientAttached(ClientInternal, VecDeque); @@ -328,6 +340,12 @@ impl ClientAttached { } } +impl AsRawFd for ClientAttached { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + #[cfg(test)] mod test { use serial_test::serial;