Struct lib::config::Args

source · []
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: OffDays

Days 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

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Is the user off now ?

Error type. Read more

Try to create a new instance of the struct. Read more

Serialize this value into the given Serde serializer. Read more

Returns clap::App corresponding to the struct.

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

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

Gets the struct from any iterator such as a Vec of your making. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The none-equivalent value.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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