pub struct WpaController { /* private fields */ }
Expand description
WPA controller
Implementations§
Source§impl WpaController
impl WpaController
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Attempts to connect to WPA controller at specified path
Sourcepub fn open_path(path: &Path) -> Result<Self, Error>
pub fn open_path(path: &Path) -> Result<Self, Error>
Attempts to connect to WPA controller at specified path
Sourcepub fn request(&mut self, req: WpaControlReq) -> Result<usize, Error>
pub fn request(&mut self, req: WpaControlReq) -> Result<usize, Error>
Sends request, returning number of bytes written.
Sourcepub fn recv(&mut self) -> Result<Option<WpaControlMessage<'_>>, Error>
pub fn recv(&mut self) -> Result<Option<WpaControlMessage<'_>>, Error>
Attempts to receive message.
Sourcepub fn recv_req_result(&mut self) -> Option<Result<Result<(), ()>, Error>>
pub fn recv_req_result(&mut self) -> Option<Result<Result<(), ()>, Error>>
Attempts to receive reply for result of command.
This method will continuously recv
skipping unsolicited
messages
§Result
-
Returns
None
if neither success or fail are present among replies. -
Ok(())
indicates success. -
Err(())
indicates failure.
Sourcepub fn add_network(
&mut self,
ssid: &str,
wpa_pass: Option<&str>,
hidden: bool,
) -> Result<Id, Error>
pub fn add_network( &mut self, ssid: &str, wpa_pass: Option<&str>, hidden: bool, ) -> Result<Id, Error>
Sourcepub fn remove_network(&mut self, id: Id) -> Result<(), Error>
pub fn remove_network(&mut self, id: Id) -> Result<(), Error>
Performs removal of known network by id
.
Sourcepub fn reconfigure(&mut self) -> Result<(), Error>
pub fn reconfigure(&mut self) -> Result<(), Error>
Reconfigure wpa, i.e. reload wpasupplicant from saved config.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WpaController
impl RefUnwindSafe for WpaController
impl Send for WpaController
impl Sync for WpaController
impl Unpin for WpaController
impl UnwindSafe for WpaController
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