#![warn(clippy::all, clippy::pedantic, missing_docs)]
use std::path::PathBuf;
mod build;
#[deprecated(note = "this struct has been renamed to `rustdoc_json::Builder`")]
pub use Builder as BuildOptions;
#[derive(thiserror::Error, Debug)]
pub enum BuildError {
#[error("Manifest must be for an actual package. `{0:?}` is a virtual manifest")]
VirtualManifest(PathBuf),
#[error("Failed to build rustdoc JSON. Stderr: {0}")]
General(String),
#[error(transparent)]
CargoTomlError(#[from] cargo_toml::Error),
#[error(transparent)]
CargoMetadataError(#[from] cargo_metadata::Error),
#[error(transparent)]
IoError(#[from] std::io::Error),
}
#[derive(Debug)]
pub struct Builder {
toolchain: Option<String>,
manifest_path: std::path::PathBuf,
target: Option<String>,
quiet: bool,
no_default_features: bool,
all_features: bool,
features: Vec<String>,
package: Option<String>,
cap_lints: Option<String>,
}
#[deprecated(note = "use `rustdoc_json::Builder::build()` instead")]
pub fn build(options: Builder) -> Result<PathBuf, BuildError> {
options.build()
}