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’s guaranteed to succeed
if matches
originates from an App
generated by [StructOpt::clap
] called on
the same type, otherwise it must panic.§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
std::env::args_os
).
Unlike [StructOpt::from_args
], returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you.§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. Read more§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 more