pub struct Args {Show 16 fields
pub proxy: ArgProxy,
pub tun: Option<String>,
pub tun_fd: Option<i32>,
pub close_fd_on_drop: Option<bool>,
pub unshare: bool,
pub unshare_pidfile: Option<String>,
pub socket_transfer_fd: Option<i32>,
pub admin_command: Vec<OsString>,
pub ipv6_enabled: bool,
pub setup: bool,
pub dns: ArgDns,
pub dns_addr: IpAddr,
pub bypass: Vec<IpCidr>,
pub tcp_timeout: u64,
pub udp_timeout: u64,
pub verbosity: ArgVerbosity,
}Fields§
§proxy: ArgProxyProxy URL in the form proto://[username[:password]@]host:port, where proto is one of socks4, socks5, http. Username and password are encoded in percent encoding. For example: socks5://myname:pass%40word@127.0.0.1:1080
tun: Option<String>Name of the tun interface, such as tun0, utun4, etc. If this option is not provided, the OS will generate a random one.
tun_fd: Option<i32>File descriptor of the tun interface
close_fd_on_drop: Option<bool>Set whether to close the received raw file descriptor on drop or not. This setting is passed to the tun2 crate. See tun2::Configuration::close_fd_on_drop.
Create a tun interface in a newly created unprivileged namespace while maintaining proxy connectivity via the global network namespace.
Create a pidfile of unshare process when using --unshare.
socket_transfer_fd: Option<i32>File descriptor for UNIX datagram socket meant to transfer
network sockets from global namespace to the new one.
See unshare(1), namespaces(7), sendmsg(2), unix(7).
admin_command: Vec<OsString>Specify a command to run with root-like capabilities in the new namespace
when using --unshare.
This could be useful to start additional daemons, e.g. openvpn instance.
ipv6_enabled: boolIPv6 enabled
setup: boolRouting and system setup, which decides whether to setup the routing and system configuration.
This option is only available on Linux and requires root-like privileges. See capabilities(7).
dns: ArgDnsDNS handling strategy
dns_addr: IpAddrDNS resolver address
bypass: Vec<IpCidr>IPs used in routing setup which should bypass the tunnel, in the form of IP or IP/CIDR. Multiple IPs can be specified, e.g. –bypass 3.4.5.0/24 –bypass 5.6.7.8
tcp_timeout: u64TCP timeout in seconds
udp_timeout: u64UDP timeout in seconds
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 close_fd_on_drop(&mut self, close_fd_on_drop: bool) -> &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: IpCidr) -> &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 CommandFactory for Args
impl CommandFactory for Args
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>
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 Args
impl Parser for Args
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 Args
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)