Skip to main content

PproxyArgs

Struct PproxyArgs 

Source
pub struct PproxyArgs {
Show 25 fields pub local: Vec<String>, pub remotes: Vec<String>, pub verbose_level: u8, pub debug: bool, pub debug_level: u8, pub daemon: bool, pub reuse_port: bool, pub auth_timeout: Option<Duration>, pub system_proxy: bool, pub help: bool, pub version: bool, pub known_unsupported: Vec<String>, pub ssl: Option<String>, pub pac: Option<String>, pub test_value: Option<String>, pub udp_listen: Vec<String>, pub udp_remote: Vec<String>, pub scheduler: Option<String>, pub alive: Option<String>, pub block_values: Vec<String>, pub log_values: Vec<String>, pub rulefile_values: Vec<String>, pub get_values: Vec<String>, pub unknown_flags: Vec<String>, pub strict_violations: Vec<String>,
}
Expand description

Parsed pproxy-compatible CLI arguments.

Fields§

§local: Vec<String>

Local listener URIs (from -l flags).

§remotes: Vec<String>

Remote/upstream URIs (from -r flags).

§verbose_level: u8

Verbosity level derived from -v/-vv/-vvv flags.

§debug: bool

-d flag: debug-level compatibility diagnostics.

§debug_level: u8

Number of -d occurrences, including clustered short options.

§daemon: bool

--daemon flag: daemon mode request (unsupported).

§reuse_port: bool

--reuse flag: listener SO_REUSEPORT.

§auth_timeout: Option<Duration>

--auth <seconds>: per-client authentication reuse interval.

§system_proxy: bool

--sys flag: apply the selected compatibility listener as the system proxy.

§help: bool

-h/--help was requested.

§version: bool

--version was requested.

§known_unsupported: Vec<String>

Known pproxy flags that require a translation decision, kept as raw key=value strings for back-compat.

Legacy name: despite unsupported in the name, this bucket carries supported/native-equivalent options too (ssl=, pac=, udp-listen=, …). It stays populated so existing API readers keep working, but authoritative state lives in the structured fields below. Internal translation and presentation code must consume the structured fields/accessors, never scan these strings.

§ssl: Option<String>

--ssl CERT,KEY raw value, if requested. Structured owner of the ssl= legacy bucket entry; drives TLS translation and the startup banner.

§pac: Option<String>

--pac PATH raw value, if requested. Structured owner of the pac= legacy bucket entry; drives admin PAC translation and the banner.

§test_value: Option<String>

--test URL raw value, if this invocation is a diagnostic probe. Structured owner of the test= legacy bucket entry.

§udp_listen: Vec<String>

-ul UDP listener values in declaration order. Structured owner of the udp-listen= legacy bucket entries.

§udp_remote: Vec<String>

-ur UDP upstream values in declaration order. Structured owner of the udp-remote= legacy bucket entries.

§scheduler: Option<String>

-s scheduler value, if given. Structured owner of the scheduler= legacy bucket entry.

§alive: Option<String>

-a alive/health-check interval value, if given. Structured owner of the alive= legacy bucket entry.

§block_values: Vec<String>

-b block pattern values in declaration order. Structured owner of the block= legacy bucket entries.

§log_values: Vec<String>

--log values in declaration order. Structured owner of the log= legacy bucket entries.

§rulefile_values: Vec<String>

--rulefile values in declaration order. Structured owner of the rulefile= legacy bucket entries.

§get_values: Vec<String>

--get PATH,FILE values in declaration order. Structured owner of the get= legacy bucket entries.

§unknown_flags: Vec<String>

Unknown flags that are not recognized.

§strict_violations: Vec<String>

Options accepted by the migration translator but not by the frozen pproxy 2.7.9 parser, plus positional arguments and long aliases. Compatibility execution treats these as parser errors.

Implementations§

Source§

impl PproxyArgs

Source

pub fn has_args(raw: &[String]) -> bool

Check whether any arguments were provided.

Source

pub fn test_target(&self) -> Option<&str>

Return the target supplied to --test, preserving the parser’s value-taking semantics for both compatibility execution entry points. Reads the structured --test field, not the legacy string bucket.

Source

pub fn recognized_option_names() -> &'static [&'static str]

Authoritative inventory of every option the frozen 2.7.9 parser recognizes, adjacent to the parser itself. The standalone help text and the help/parser drift test consume this metadata so recognized options cannot silently drift away from documented ones.

Source

pub fn udp_listen_addrs(&self) -> Vec<&str>

Structured presentation state for the startup banner and diagnostics.

These accessors read the typed parser fields. The legacy known_unsupported string bucket stays populated for back-compat but must not be scanned by internal code.

Whether each entry blocks startup is decided separately by the execution gate over the translation output, never by these presentation helpers.

UDP listener addresses from -ul, in declaration order.

Source

pub fn udp_remote_addrs(&self) -> Vec<&str>

UDP upstream values from -ur, in declaration order.

Source

pub fn tls_requested(&self) -> bool

Whether TLS was requested on listeners via --ssl.

Source

pub fn tls_value(&self) -> Option<&str>

Raw --ssl CERT,KEY value, if requested.

Source

pub fn pac_requested(&self) -> bool

Whether PAC serving was requested via --pac.

Source

pub fn pac_value(&self) -> Option<&str>

Raw --pac value, if requested.

Source

pub fn scheduler_value(&self) -> Option<&str>

Raw -s scheduler value, if given.

Source

pub fn alive_value(&self) -> Option<&str>

Raw -a alive interval value, if given.

Source

pub fn default_args() -> Self

Create default pproxy args equivalent to running pproxy with no arguments.

Real pproxy defaults to a mixed HTTP/SOCKS4/SOCKS5 listener on :8080 with direct routing.

Source

pub fn parse(raw: &[String]) -> Result<Self, CompatError>

Parse from raw argument list (excluding argv[0]).

Source

pub fn unknown_flag_diagnostics(&self) -> Vec<CompatWarning>

Identify unrecognized flags and return diagnostics for them.

Source

pub fn unknown_flag_translation_output(&self) -> TranslationOutput

Return a TranslationOutput containing the unknown-flag diagnostics.

Source

pub fn has_unknown_or_unsupported(&self) -> bool

Check if there are any unknown or translation-decision flags.

Legacy parser-bucket check: true when unknown flags, the legacy known_unsupported translation bucket, or --daemon are present. This is not the execution decision — startup blocking is owned by crate::gate::evaluate over the translation output.

Source

pub fn strict_parser_violations(&self) -> Vec<String>

Return parser violations against the exact 2.7.9 command surface.

Source

pub fn version_string() -> String

Version string used by all compatibility entry points.

Source

pub fn validate_strict_values(&self) -> Result<(), CompatError>

Validate values whose upstream argparse type= callbacks run during parsing. URI failures therefore stay in the CLI-parse category rather than being reported as a later runtime/configuration failure. Reads the structured parser fields, not the legacy string bucket.

Source

pub fn effective_auth_timeout(&self) -> Duration

Return the pproxy default re-authentication interval when --auth was omitted. The field remains optional so translation/API callers can distinguish an explicit compatibility option from the parser default.

Source

pub fn default_log_level(&self) -> &'static str

Default tracing log level chosen from -d and -v verbosity flags.

Resolution order (highest precedence first):

  1. -vvv -> trace
  2. -v / -vv / -d -> debug
  3. otherwise -> info

-d is independent of -v and of --daemon. This helper is the single source of truth used by the standalone compatibility binary (and tests) so the observable behavior of -d is testable without depending on tracing internals.

An explicit RUST_LOG environment variable remains authoritative at the tracing_subscriber layer; this helper is only consulted when RUST_LOG is unset or invalid.

Source

pub fn parse_local_uris(&self) -> Result<Vec<PproxyUri>, CompatError>

Parse all local URIs into typed representations.

Source

pub fn parse_remote_uris(&self) -> Result<Vec<PproxyUri>, CompatError>

Parse all remote URIs into typed representations.

Source

pub fn parse_remote_chains(&self) -> Result<Vec<PproxyChain>, CompatError>

Parse all remote URIs into chain representations (supports __ separators).

Trait Implementations§

Source§

impl Clone for PproxyArgs

Source§

fn clone(&self) -> PproxyArgs

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PproxyArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more