pub struct Args {Show 15 fields
pub interface_name: Option<String>,
pub status: Vec<String>,
pub mm_url: Option<String>,
pub mm_user: Option<String>,
pub secret_type: Option<SecretType>,
pub keyring_service: Option<String>,
pub mm_secret: Option<String>,
pub mm_secret_cmd: Option<String>,
pub state_dir: Option<PathBuf>,
pub begin: Option<String>,
pub end: Option<String>,
pub expires_at: Option<String>,
pub delay: Option<u32>,
pub verbose: QuietVerbose,
pub offdays: OffDays,
}Expand description
Automate mattermost status with the help of wifi network
Use current visible wifi SSID to automate your mattermost status.
This program is meant to either be running in background or be call regularly
with option --delay 0.
It will then update your mattermost custom status according to the config file
Fields
interface_name: Option<String>wifi interface name
status: Vec<String>Status configuration triplets (:: separated)
Each triplet shall have the format:
“wifi_substring::emoji_name::status_text”. If wifi_substring is empty, the ssociated
status will be used for off time.
mm_url: Option<String>mattermost URL
mm_user: Option<String>User name used for mattermost login or for password or private token lookup in OS keyring.
secret_type: Option<SecretType>Type of secret. Either Password (default) or Token
keyring_service: Option<String>Service name used for mattermost secret lookup in OS keyring.
The secret is either a password (default) or atoken according to
secret_type option
mm_secret: Option<String>mattermost private Token
Usage of this option may leak your personal token. It is recommended to
use mm_token_cmd or keyring_service.
The secret is either a password (default) or atoken according to
secret_type option
mm_secret_cmd: Option<String>mattermost secret command
The secret is either a password (default) or atoken according to
secret_type option
state_dir: Option<PathBuf>directory for state file
Will use content of XDG_CACHE_HOME if unset.
begin: Option<String>beginning of status update with the format hh:mm
Before this time the status won’t be updated
end: Option<String>end of status update with the format hh:mm
After this time the status won’t be updated
expires_at: Option<String>Expiration time with the format hh:mm
This parameter is used to set the custom status expiration time Set to “0” to avoid setting expiration time
delay: Option<u32>delay between wifi SSID polling in seconds
verbose: QuietVerboseoffdays: OffDaysDays off for which the custom status shall not be changed
Implementations
Update args.mm_secret with the one fetched from OS keyring
Update args.mm_secret with the standard output of
args.mm_secret_cmd if defined.
If the secret is a password, secret will be updated later when login to the mattermost
server
Merge with precedence default Args, config file and command line parameters.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Builds the struct from 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. Read more
Builds the struct from the command line arguments (std::env::args_os).
Calls clap::Error::exit on failure, printing the error message and aborting the program. Read more
Builds the struct from the command line arguments (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. Read more
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a 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> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec of your making. Read more
Auto Trait Implementations
impl RefUnwindSafe for Args
impl UnwindSafe for Args
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> NoneValue for T where
T: Default,
impl<T> NoneValue for T where
T: Default,
type NoneType = T
pub fn null_value() -> T
pub fn null_value() -> T
The none-equivalent value.
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more