pub struct Config {
pub listen_addr: SocketAddr,
pub dns_remote_server: SocketAddr,
pub socks5_settings: ArgProxy,
pub force_tcp: bool,
pub cache_records: bool,
pub verbosity: ArgVerbosity,
pub timeout: u64,
}Expand description
Proxy server to routing DNS query to SOCKS5 server
Fields§
§listen_addr: SocketAddrListen address
dns_remote_server: SocketAddrRemote DNS server address
socks5_settings: ArgProxySOCKS5 URL in the form socks5://[username[:password]@]host:port, Username and password are encoded in percent encoding. For example: socks5://myname:pass%40word@127.0.0.1:1080
force_tcp: boolForce to use TCP to proxy DNS query
cache_records: boolCache DNS query records
verbosity: ArgVerbosityVerbosity level
timeout: u64Timeout for DNS query
Implementations§
Source§impl Config
impl Config
pub fn parse_args() -> Self
pub fn listen_addr(&mut self, listen_addr: SocketAddr) -> &mut Self
pub fn dns_remote_server(&mut self, dns_remote_server: SocketAddr) -> &mut Self
pub fn socks5_settings(&mut self, socks5_settings: ArgProxy) -> &mut Self
pub fn force_tcp(&mut self, force_tcp: bool) -> &mut Self
pub fn cache_records(&mut self, cache_records: bool) -> &mut Self
pub fn verbosity(&mut self, verbosity: ArgVerbosity) -> &mut Self
pub fn timeout(&mut self, timeout: u64) -> &mut Self
Trait Implementations§
Source§impl Args for Config
impl Args for Config
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
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Config
impl CommandFactory for Config
Source§impl FromArgMatches for Config
impl FromArgMatches for Config
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 Config
impl Parser for Config
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§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.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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