pub struct RustdocBuilder { /* private fields */ }Expand description
Orchestrates cargo doc invocations for packages and workspaces.
Implementations§
Source§impl RustdocBuilder
impl RustdocBuilder
Sourcepub fn new(config: RustdocConfig) -> Self
pub fn new(config: RustdocConfig) -> Self
Create a new builder from a configuration.
Sourcepub fn config(&self) -> &RustdocConfig
pub fn config(&self) -> &RustdocConfig
Access the current configuration.
Sourcepub fn configure_theme(&mut self, theme: DocTheme)
pub fn configure_theme(&mut self, theme: DocTheme)
Set the documentation theme.
Sourcepub fn generate_docs(&self) -> String
pub fn generate_docs(&self) -> String
Generate the command to build documentation for a single package.
Sourcepub fn generate_package_docs(&self, package_name: &str) -> String
pub fn generate_package_docs(&self, package_name: &str) -> String
Generate the command to build documentation for a specific package within a workspace.
Sourcepub fn generate_workspace_docs(&self) -> String
pub fn generate_workspace_docs(&self) -> String
Generate the command to build documentation for the entire workspace.
Sourcepub fn generate_search_index(
&mut self,
items: Vec<DocItem>,
) -> Result<&DocIndex, KernelError>
pub fn generate_search_index( &mut self, items: Vec<DocItem>, ) -> Result<&DocIndex, KernelError>
Build the search index from a list of discovered items.
In a real implementation this would parse the generated
search-index.js or walk the source AST; here we accept a
pre-collected list for testability.
Sourcepub fn crate_doc_path(&self, crate_name: &str) -> String
pub fn crate_doc_path(&self, crate_name: &str) -> String
Return the HTML output root for a given crate.
Sourcepub fn index_html_path(&self) -> String
pub fn index_html_path(&self) -> String
Return the full path to the top-level index.html.
Sourcepub fn server_config(&self, port: u16) -> DocServerConfig
pub fn server_config(&self, port: u16) -> DocServerConfig
Create a DocServerConfig for serving the generated docs.
Sourcepub fn cross_reference_flags(&self, crate_names: &[&str]) -> Vec<String>
pub fn cross_reference_flags(&self, crate_names: &[&str]) -> Vec<String>
Generate cross-reference extern flags for linking between crates in a workspace.