Skip to main content

PproxyArgs

Struct PproxyArgs 

Source
pub struct PproxyArgs {
Show 14 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 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-but-unsupported flags that require a translation decision.

§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.

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 unsupported flags.

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.

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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