Struct rustdoc_json::Builder
source · [−]pub struct Builder { /* private fields */ }
Expand description
Options for building a rustdoc json file.
See crate for an example on how to use it.
Implementations
sourceimpl Builder
impl Builder
sourcepub fn toolchain(self, toolchain: impl Into<Option<String>>) -> Self
pub fn toolchain(self, toolchain: impl Into<Option<String>>) -> Self
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.
sourcepub fn manifest_path(self, manifest_path: impl AsRef<Path>) -> Self
pub fn manifest_path(self, manifest_path: impl AsRef<Path>) -> Self
Set the relative or absolute path to Cargo.toml
. Default: Cargo.toml
sourcepub fn target_dir(self, target_dir: impl AsRef<Path>) -> Self
pub fn target_dir(self, target_dir: impl AsRef<Path>) -> Self
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.
sourcepub const fn quiet(self, quiet: bool) -> Self
pub const fn quiet(self, quiet: bool) -> Self
Whether or not to pass --quiet
to cargo rustdoc
. Default: false
sourcepub fn target(self, target: String) -> Self
pub fn target(self, target: String) -> Self
Whether or not to pass --target
to cargo rustdoc
. Default: None
sourcepub const fn no_default_features(self, no_default_features: bool) -> Self
pub const fn no_default_features(self, no_default_features: bool) -> Self
Whether to pass --no-default-features
to cargo rustdoc
. Default: false
sourcepub const fn all_features(self, all_features: bool) -> Self
pub const fn all_features(self, all_features: bool) -> Self
Whether to pass --all-features
to cargo rustdoc
. Default: false
sourcepub fn features<I: IntoIterator<Item = S>, S: AsRef<str>>(
self,
features: I
) -> Self
pub fn features<I: IntoIterator<Item = S>, S: AsRef<str>>(
self,
features: I
) -> Self
Features to pass to cargo rustdoc
via --features
. Default to an empty vector
sourcepub fn package(self, package: impl AsRef<str>) -> Self
pub fn package(self, package: impl AsRef<str>) -> Self
Package to use for cargo rustdoc
via -p
. Default: None