pub struct RemoveArgs {
pub ssid: String,
pub security_type: Option<SecurityTypeArg>,
pub credential_type: Option<CredentialTypeArg>,
pub credential: Option<String>,
}
Expand description
Remove args are similar to SaveNetworkArgs but with optional security type and credential because it can match to saved networks with just SSID. Examples of valid arguments: –ssid MyNetwork –ssid MyNetwork –security-type wpa2 –ssid MyNetwork –credential MyPassword (defaults to credential-type: password) –ssid MyNetwork –credential-type password –credential MyPassword Example of invalid arguments: –ssid MyNetwork –security-type none –credential MyPassword –ssid MyNetwork –credential-type password
Fields§
§ssid: String
§security_type: Option<SecurityTypeArg>
§credential_type: Option<CredentialTypeArg>
§credential: Option<String>
Implementations§
Source§impl RemoveArgs
impl RemoveArgs
pub fn parse_security(&self) -> Option<SecurityType>
Sourcepub fn try_parse_credential(&self) -> Result<Option<Credential>, Error>
pub fn try_parse_credential(&self) -> Result<Option<Credential>, Error>
Determine the credential to use based on security_type, credential_type, and credential. If a value is provided without a type, Password will be used by default for open networks.
This includes a bunch of if statements for edge cases such as a credential being provided as “” or a credential type that conflicts with the credential value. But it does not check all input errors such as invalid PSK length or all conflicting security credential pairs.
Trait Implementations§
Source§impl Clone for RemoveArgs
impl Clone for RemoveArgs
Source§fn clone(&self) -> RemoveArgs
fn clone(&self) -> RemoveArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RemoveArgs
impl Debug for RemoveArgs
Source§impl StructOpt for RemoveArgs
impl StructOpt for RemoveArgs
Source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches
. It cannot fail
with a parameter generated by clap
by construction.§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
§fn from_iter<I>(iter: I) -> Self
fn from_iter<I>(iter: I) -> Self
Vec
of your making.
Print the error message and quit the program in case of failure.§fn from_iter_safe<I>(iter: I) -> Result<Self, Error>
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>
Vec
of your making. Read moreAuto Trait Implementations§
impl Freeze for RemoveArgs
impl RefUnwindSafe for RemoveArgs
impl Send for RemoveArgs
impl Sync for RemoveArgs
impl Unpin for RemoveArgs
impl UnwindSafe for RemoveArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)