pub struct Cli {Show 24 fields
pub json: bool,
pub format: Option<OutputFormat>,
pub timeout: Option<u64>,
pub connect_timeout: Option<u64>,
pub user_agent: Option<String>,
pub lang: Option<String>,
pub config_dir: Option<PathBuf>,
pub cache_dir: Option<PathBuf>,
pub no_cache: bool,
pub cache_ttl_secs: Option<u64>,
pub max_cache_bytes: Option<u64>,
pub dry_run: bool,
pub max_body_bytes: Option<u64>,
pub max_output_bytes: Option<u64>,
pub rate_limit_delay_ms: Option<u64>,
pub max_concurrency: Option<u32>,
pub max_retries: Option<u32>,
pub retry_base_ms: Option<u64>,
pub retry_max_delay_ms: Option<u64>,
pub disable_retry: bool,
pub verbose: u8,
pub quiet: bool,
pub no_color: bool,
pub command: Commands,
}Expand description
Top-level clap parser for the docsrs-cli binary.
Fields§
§json: boolEmit JSON envelope on stdout
format: Option<OutputFormat>Output format (json is alias of –json)
timeout: Option<u64>Wall-clock timeout in seconds (must be >= 1 when set)
connect_timeout: Option<u64>Connect timeout in seconds (must be >= 1 when set)
user_agent: Option<String>Override User-Agent
lang: Option<String>Force human stderr locale: en or pt-BR (fail-closed; JSON stays English)
config_dir: Option<PathBuf>Override XDG config directory
cache_dir: Option<PathBuf>Override XDG cache directory for HTTP body cache
no_cache: boolDisable disk cache (always hit network)
cache_ttl_secs: Option<u64>Disk cache TTL in seconds (default 86400 = 24h)
max_cache_bytes: Option<u64>Soft cap on disk cache size in bytes (default 268435456 = 256 MiB; 0 = unlimited)
dry_run: boolPlan URLs without opening network sockets
max_body_bytes: Option<u64>Cap downloaded body size in bytes (hard max 10485760 = 10 MiB; cannot raise above)
max_output_bytes: Option<u64>Cap emitted payload size in bytes (hard max 2097152 = 2 MiB; cannot raise above)
rate_limit_delay_ms: Option<u64>Minimum delay between requests to the same host (ms)
max_concurrency: Option<u32>Max concurrent CPU parse workers (0 = auto from CPUs and free RAM)
max_retries: Option<u32>Max HTTP retries for transient errors (after the first attempt)
retry_base_ms: Option<u64>Base backoff delay in milliseconds for HTTP retries
retry_max_delay_ms: Option<u64>Maximum single HTTP retry sleep in milliseconds
disable_retry: boolDisable HTTP retries (incident kill switch / debug)
verbose: u8Increase stderr verbosity
quiet: boolSuppress non-error stderr prose
no_color: boolDisable ANSI colors on stderr
command: CommandsSubcommand to execute for this invocation.
Implementations§
Source§impl Cli
impl Cli
Sourcepub fn wants_json(&self, stdout_is_terminal: bool) -> bool
pub fn wants_json(&self, stdout_is_terminal: bool) -> bool
Whether JSON envelope is requested.
Agent-first rules (stdin/stdout LLM contract):
--jsonor--format json→ JSON--format markdown|text→ human (never auto-JSON)- otherwise → JSON when stdout is not a TTY (pipe/agent), markdown on TTY
Sourcepub fn validate_format_conflict(&self) -> Result<(), AppError>
pub fn validate_format_conflict(&self) -> Result<(), AppError>
Reject incompatible --json + --format text|markdown.
§Errors
Returns crate::error::ErrorKind::Usage when --json is combined with
--format text or --format markdown.
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
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
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
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 Cli
impl Parser for Cli
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 Cli
impl RefUnwindSafe for Cli
impl Send for Cli
impl Sync for Cli
impl Unpin for Cli
impl UnsafeUnpin for Cli
impl UnwindSafe for Cli
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more