rustdoc::config

Struct Options

Source
pub(crate) struct Options {
Show 42 fields pub(crate) crate_name: Option<String>, pub(crate) bin_crate: bool, pub(crate) proc_macro_crate: bool, pub(crate) error_format: ErrorOutputType, pub(crate) diagnostic_width: Option<usize>, pub(crate) libs: Vec<SearchPath>, pub(crate) lib_strs: Vec<String>, pub(crate) externs: Externs, pub(crate) extern_strs: Vec<String>, pub(crate) cfgs: Vec<String>, pub(crate) check_cfgs: Vec<String>, pub(crate) codegen_options: CodegenOptions, pub(crate) codegen_options_strs: Vec<String>, pub(crate) unstable_opts: UnstableOptions, pub(crate) unstable_opts_strs: Vec<String>, pub(crate) target: TargetTuple, pub(crate) edition: Edition, pub(crate) maybe_sysroot: Option<PathBuf>, pub(crate) lint_opts: Vec<(String, Level)>, pub(crate) describe_lints: bool, pub(crate) lint_cap: Option<Level>, pub(crate) should_test: bool, pub(crate) test_args: Vec<String>, pub(crate) test_run_directory: Option<PathBuf>, pub(crate) persist_doctests: Option<PathBuf>, pub(crate) runtool: Option<String>, pub(crate) runtool_args: Vec<String>, pub(crate) enable_per_target_ignores: bool, pub(crate) no_run: bool, pub(crate) remap_path_prefix: Vec<(PathBuf, PathBuf)>, pub(crate) test_builder: Option<PathBuf>, pub(crate) test_builder_wrappers: Vec<PathBuf>, pub(crate) show_coverage: bool, pub(crate) crate_version: Option<String>, pub(crate) output_format: OutputFormat, pub(crate) run_check: bool, pub(crate) json_unused_externs: JsonUnusedExterns, pub(crate) nocapture: bool, pub(crate) scrape_examples_options: Option<ScrapeExamplesOptions>, pub(crate) unstable_features: UnstableFeatures, pub(crate) expanded_args: Vec<String>, pub(crate) doctest_compilation_args: Vec<String>,
}
Expand description

Configuration options for rustdoc.

Fields§

§crate_name: Option<String>

The name of the crate being documented.

§bin_crate: bool

Whether or not this is a bin crate

§proc_macro_crate: bool

Whether or not this is a proc-macro crate

§error_format: ErrorOutputType

How to format errors and warnings.

§diagnostic_width: Option<usize>

Width of output buffer to truncate errors appropriately.

§libs: Vec<SearchPath>

Library search paths to hand to the compiler.

§lib_strs: Vec<String>

Library search paths strings to hand to the compiler.

§externs: Externs

The list of external crates to link against.

§extern_strs: Vec<String>

The list of external crates strings to link against.

§cfgs: Vec<String>

List of cfg flags to hand to the compiler. Always includes rustdoc.

§check_cfgs: Vec<String>

List of check cfg flags to hand to the compiler.

§codegen_options: CodegenOptions

Codegen options to hand to the compiler.

§codegen_options_strs: Vec<String>

Codegen options strings to hand to the compiler.

§unstable_opts: UnstableOptions

Unstable (-Z) options to pass to the compiler.

§unstable_opts_strs: Vec<String>

Unstable (-Z) options strings to pass to the compiler.

§target: TargetTuple

The target used to compile the crate against.

§edition: Edition

Edition used when reading the crate. Defaults to “2015”. Also used by default when compiling doctests from the crate.

§maybe_sysroot: Option<PathBuf>

The path to the sysroot. Used during the compilation process.

§lint_opts: Vec<(String, Level)>

Lint information passed over the command-line.

§describe_lints: bool

Whether to ask rustc to describe the lints it knows.

§lint_cap: Option<Level>

What level to cap lints at.

§should_test: bool

Whether we should run doctests instead of generating docs.

§test_args: Vec<String>

List of arguments to pass to the test harness, if running tests.

§test_run_directory: Option<PathBuf>

The working directory in which to run tests.

§persist_doctests: Option<PathBuf>

Optional path to persist the doctest executables to, defaults to a temporary directory if not set.

§runtool: Option<String>

Runtool to run doctests with

§runtool_args: Vec<String>

Arguments to pass to the runtool

§enable_per_target_ignores: bool

Whether to allow ignoring doctests on a per-target basis For example, using ignore-foo to ignore running the doctest on any target that contains “foo” as a substring

§no_run: bool

Do not run doctests, compile them if should_test is active.

§remap_path_prefix: Vec<(PathBuf, PathBuf)>

What sources are being mapped.

§test_builder: Option<PathBuf>

The path to a rustc-like binary to build tests with. If not set, we default to loading from $sysroot/bin/rustc.

§test_builder_wrappers: Vec<PathBuf>

Run these wrapper instead of rustc directly

§show_coverage: bool

Whether to run the calculate-doc-coverage pass, which counts the number of public items with and without documentation.

§crate_version: Option<String>

Crate version to note on the sidebar of generated docs.

§output_format: OutputFormat

The format that we output when rendering.

Currently used only for the --show-coverage option.

§run_check: bool

If this option is set to true, rustdoc will only run checks and not generate documentation.

§json_unused_externs: JsonUnusedExterns

Whether doctests should emit unused externs

§nocapture: bool

Whether to skip capturing stdout and stderr of tests.

§scrape_examples_options: Option<ScrapeExamplesOptions>

Configuration for scraping examples from the current crate. If this option is Some(..) then the compiler will scrape examples and not generate documentation.

§unstable_features: UnstableFeatures

Note: this field is duplicated in RenderOptions because it’s useful to have it in both places.

§expanded_args: Vec<String>

All commandline args used to invoke the compiler, with @file args fully expanded. This will only be used within debug info, e.g. in the pdb file on windows This is mainly useful for other tools that reads that debuginfo to figure out how to call the compiler with the same arguments.

§doctest_compilation_args: Vec<String>

Arguments to be used when compiling doctests.

Implementations§

Source§

impl Options

Source

pub(crate) fn from_matches( early_dcx: &mut EarlyDiagCtxt, matches: &Matches, args: Vec<String>, ) -> Option<(InputMode, Options, RenderOptions)>

Parses the given command-line for options. If an error message or other early-return has been printed, returns Err with the exit code.

Trait Implementations§

Source§

impl Clone for Options

Source§

fn clone(&self) -> Options

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Options

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 2280 bytes