pub struct Args {
pub proxy: ArgProxy,
pub tun: String,
pub tun_fd: Option<i32>,
pub ipv6_enabled: bool,
pub setup: bool,
pub dns: ArgDns,
pub dns_addr: IpAddr,
pub bypass: Vec<IpAddr>,
pub verbosity: ArgVerbosity,
}Fields§
§proxy: ArgProxyProxy URL in the form proto://[username[:password]@]host:port, where proto is one of socks4, socks5, http. For example: socks5://myname:password@127.0.0.1:1080
tun: StringName of the tun interface
tun_fd: Option<i32>File descriptor of the tun interface
ipv6_enabled: boolIPv6 enabled
setup: boolRouting and system setup, which decides whether to setup the routing and system configuration, this option requires root privileges
dns: ArgDnsDNS handling strategy
dns_addr: IpAddrDNS resolver address
bypass: Vec<IpAddr>IPs used in routing setup which should bypass the tunnel
verbosity: ArgVerbosityVerbosity level
Implementations§
source§impl Args
impl Args
pub fn parse_args() -> Self
pub fn proxy(&mut self, proxy: ArgProxy) -> &mut Self
pub fn dns(&mut self, dns: ArgDns) -> &mut Self
pub fn tun_fd(&mut self, tun_fd: Option<i32>) -> &mut Self
pub fn verbosity(&mut self, verbosity: ArgVerbosity) -> &mut Self
pub fn tun(&mut self, tun: String) -> &mut Self
pub fn dns_addr(&mut self, dns_addr: IpAddr) -> &mut Self
pub fn bypass(&mut self, bypass: IpAddr) -> &mut Self
pub fn ipv6_enabled(&mut self, ipv6_enabled: bool) -> &mut Self
pub fn setup(&mut self, setup: bool) -> &mut Self
Trait Implementations§
source§impl Args for Args
impl Args for Args
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
source§impl FromArgMatches for Args
impl FromArgMatches for Args
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 Args
impl Parser for Args
§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.
§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 RefUnwindSafe for Args
impl Send for Args
impl Sync for Args
impl Unpin for Args
impl UnwindSafe for Args
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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any.