pub struct CliServerArgs {
pub hostname: String,
pub port: u16,
pub verbose: u8,
pub debug: u8,
pub trace: u8,
pub width: u16,
pub height: u16,
}
Expand description
Represents command line arguments for a server in a CLI application.
Similar to CliClientArgs
, this struct is for parsing server-specific command line arguments.
It uses the clap
crate for parsing.
§Fields
hostname
: A string specifying the hostname. Defaults to “localhost”.port
: A 16-bit unsigned integer specifying the port number. Defaults to 8787.verbose
: A boolean flag to enable/disable logging. Defaults to false.debug
: A boolean flag to enable/disable debug mode. Defaults to false.width
: A 16-bit unsigned integer specifying the width of the window. Defaults to 1200.height
: A 16-bit unsigned integer specifying the height of the window. Defaults to 1200.
§Example
Command line usage for the server might be:
server -H 192.168.1.0 -P 8787
Fields§
§hostname: String
The hostname of the server. Default: “localhost”
port: u16
The port number the server listens on. Default: 8787
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
width: u16
Optional: Add a flag to edit the width and height of the window. Default: 1200
height: u16
Optional: Add a flag to edit the width and height of the window. Default: 1200
Trait Implementations§
Source§impl Args for CliServerArgs
impl Args for CliServerArgs
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 CliServerArgs
impl Clone for CliServerArgs
Source§fn clone(&self) -> CliServerArgs
fn clone(&self) -> CliServerArgs
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 CliServerArgs
impl CommandFactory for CliServerArgs
Source§impl Debug for CliServerArgs
impl Debug for CliServerArgs
Source§impl FromArgMatches for CliServerArgs
impl FromArgMatches for CliServerArgs
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 CliServerArgs
impl Parser for CliServerArgs
§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 CliServerArgs
impl RefUnwindSafe for CliServerArgs
impl Send for CliServerArgs
impl Sync for CliServerArgs
impl Unpin for CliServerArgs
impl UnwindSafe for CliServerArgs
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