pub struct CliClientArgs {
pub hostname: String,
pub port: u16,
pub worker_name: String,
pub verbose: u8,
pub debug: u8,
pub trace: u8,
pub open: bool,
pub save: bool,
}
Expand description
Represents command line arguments for a client in a CLI application.
This struct is used to parse and store command line arguments specific to the client part of an application.
It leverages the clap
crate for argument parsing.
§Fields
hostname
: A string specifying the hostname. Defaults to “localhost”.port
: A 16-bit unsigned integer specifying the port number. Defaults to 8787.worker_name
: A string specifying the name of the worker. Defaults to “worker”.
§Example
Command line usage might look like this:
worker -H 192.168.1.0 -P 8787 -N my_group_name
Fields§
§hostname: String
Optional: The hostname of the client. Default: “localhost”
port: u16
Optional: The port number to connect on. Default: 8787
worker_name: String
Optional: The name of the worker. Default: “worker”
verbose: u8
Optional: Add a flag to enable/disable logging. Default: 0
debug: u8
Optional: Add a flag to enable/disable debug mode. Default: 0
trace: u8
Optional: Add a flag to enable/disable trace mode. Default: 0
open: bool
Optional: Add a flag to enable/disable opening the browser. Default: false
save: bool
Optional: Add a flag to save the image to a file. Default: false
Trait Implementations§
Source§impl Args for CliClientArgs
impl Args for CliClientArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command
] so it can instantiate self
via
[FromArgMatches::update_from_arg_matches_mut
] Read moreSource§impl Clone for CliClientArgs
impl Clone for CliClientArgs
Source§fn clone(&self) -> CliClientArgs
fn clone(&self) -> CliClientArgs
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl CommandFactory for CliClientArgs
impl CommandFactory for CliClientArgs
Source§impl Debug for CliClientArgs
impl Debug for CliClientArgs
Source§impl FromArgMatches for CliClientArgs
impl FromArgMatches for CliClientArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Source§impl Parser for CliClientArgs
impl Parser for CliClientArgs
§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, [exit][Error::exit] on error.
§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Update from iterator, [exit][Error::exit] on error. Read more
§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
Update from iterator, return Err on error.
Auto Trait Implementations§
impl Freeze for CliClientArgs
impl RefUnwindSafe for CliClientArgs
impl Send for CliClientArgs
impl Sync for CliClientArgs
impl Unpin for CliClientArgs
impl UnwindSafe for CliClientArgs
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