pub struct ListenerAddressLFlag {
pub listen_address: Option<ListenerAddress>,
pub listener_options: UserOptions,
}
Expand description
Clap helper to provide optional listener address a named argument --listen-address
or -l
.
For clap(flatten)
-ing into your primary options struct.
Also invides a number of additional optional options to adjust the way it listens.
Provides documentation about how to specify listening addresses into --help
.
Example:
#[derive(Parser)]
/// Doc comment here is highly adviced
struct Args {
#[clap(flatten)]
listener: tokio_listener::ListenerAddressLFlag,
}
Fields§
§listen_address: Option<ListenerAddress>
Socket address to listen for incoming connections.
Various types of addresses are supported:
-
TCP socket address and port, like 127.0.0.1:8080 or [::]:80
-
UNIX socket path like /tmp/mysock or Linux abstract address like @abstract
-
Special keyword “inetd” for serving one connection from stdin/stdout
-
Special keyword “sd-listen” to accept connections from file descriptor 3 (e.g. systemd socket activation). You can also specify a named descriptor after a colon or * to use all passed sockets (if this feature is enabled)
listener_options: UserOptions
Implementations§
Trait Implementations§
source§impl Args for ListenerAddressLFlag
impl Args for ListenerAddressLFlag
source§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
Command
so it can instantiate self
via
FromArgMatches::update_from_arg_matches_mut
Read moresource§impl FromArgMatches for ListenerAddressLFlag
impl FromArgMatches for ListenerAddressLFlag
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>
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>
ArgMatches
to self
.source§impl Parser for ListenerAddressLFlag
impl Parser for ListenerAddressLFlag
source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for ListenerAddressLFlag
impl RefUnwindSafe for ListenerAddressLFlag
impl Send for ListenerAddressLFlag
impl Sync for ListenerAddressLFlag
impl Unpin for ListenerAddressLFlag
impl UnwindSafe for ListenerAddressLFlag
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request