Struct rustdoc_json::Builder

source ·
pub struct Builder { /* private fields */ }
Expand description

Builds rustdoc JSON. There are many build options. Refer to the docs to learn about them all. See top-level docs for an example on how to use this builder.

Implementations§

Set the toolchain. Default: None. Until rustdoc JSON has stabilized, you will want to set this to be "nightly" or similar.

If the toolchain is set as None, the current active toolchain will be used.

Notes

The currently active toolchain is typically specified by the RUSTUP_TOOLCHAIN environment variable, which the rustup proxy mechanism sets. See https://rust-lang.github.io/rustup/overrides.html for more info on how the active toolchain is determined.

Set the relative or absolute path to Cargo.toml. Default: Cargo.toml

Set what --target-dir to pass to cargo. Typically only needed if you want to be able to build rustdoc JSON for the same crate concurrently, for example to parallelize regression tests.

Clear a target dir previously set with Self::target_dir.

Whether or not to pass --quiet to cargo rustdoc. Default: false

Whether or not to pass --target to cargo rustdoc. Default: None

Whether to pass --no-default-features to cargo rustdoc. Default: false

Whether to pass --all-features to cargo rustdoc. Default: false

Features to pass to cargo rustdoc via --features. Default to an empty vector

Package to use for cargo rustdoc via -p. Default: None

Whether to pass --document-private-items to cargo rustdoc. Default: false

What to pass as --cap-lints to rustdoc JSON build command

Generate rustdoc JSON for a library crate. Returns the path to the freshly built rustdoc JSON file.

See top-level docs for an example on how to use it.

Errors

E.g. if building the JSON fails or if the manifest path does not exist or is invalid.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.