pub struct DocPackageBuilder<'a> {
stub_info: &'a StubInfo,
export_resolver: ExportResolver<'a>,
export_map: BTreeMap<String, String>,
default_module_name: String,
}Expand description
Builder for converting StubInfo to DocPackage
Fields§
§stub_info: &'a StubInfo§export_resolver: ExportResolver<'a>§export_map: BTreeMap<String, String>§default_module_name: StringImplementations§
Source§impl<'a> DocPackageBuilder<'a>
impl<'a> DocPackageBuilder<'a>
pub fn new(stub_info: &'a StubInfo) -> Self
Sourcefn create_context<'b>(&'b self, module: &'b str) -> DocBuildContext<'b>
fn create_context<'b>(&'b self, module: &'b str) -> DocBuildContext<'b>
Create a build context for a specific module
pub fn build(self) -> Result<DocPackage>
fn build_module(&self, name: &str, module: &Module) -> Result<DocModule>
fn build_function( &self, module: &str, func_defs: &[FunctionDef], ) -> Result<DocItem>
fn build_signature_from_params( &self, module: &str, parameters: &Parameters, return_type: &TypeInfo, ) -> Result<DocSignature>
fn build_signature( &self, module: &str, def: &FunctionDef, ) -> Result<DocSignature>
fn build_signature_from_method( &self, module: &str, def: &MethodDef, ) -> Result<DocSignature>
fn build_type_alias( &self, module: &str, alias: &TypeAliasDef, ) -> Result<DocItem>
fn build_class(&self, module: &str, class: &ClassDef) -> Result<DocItem>
fn build_enum_as_class( &self, _module: &str, enum_def: &EnumDef, ) -> Result<DocItem>
fn build_variable(&self, module: &str, var: &VariableDef) -> Result<DocItem>
Sourcefn build_reexported_item(
&self,
source_module_name: &str,
source_module: &Module,
item_name: &str,
) -> Result<Option<DocItem>>
fn build_reexported_item( &self, source_module_name: &str, source_module: &Module, item_name: &str, ) -> Result<Option<DocItem>>
Build a re-exported item from a source module
Sourcefn correct_link_targets(&self, item: &mut DocItem, _target_module: &str)
fn correct_link_targets(&self, item: &mut DocItem, _target_module: &str)
Correct link targets in a re-exported item to point to the target module
Sourcefn correct_type_expr(&self, type_expr: &mut DocTypeExpr)
fn correct_type_expr(&self, type_expr: &mut DocTypeExpr)
Correct a type expression to use export_map for link targets
Sourcefn strip_internal_module_prefix(&self, display: &str) -> String
fn strip_internal_module_prefix(&self, display: &str) -> String
Strip internal module prefixes (modules starting with ‘_’) from display text e.g., “_core.A” -> “A”, “_internal.Foo” -> “Foo”
Auto Trait Implementations§
impl<'a> Freeze for DocPackageBuilder<'a>
impl<'a> RefUnwindSafe for DocPackageBuilder<'a>
impl<'a> Send for DocPackageBuilder<'a>
impl<'a> Sync for DocPackageBuilder<'a>
impl<'a> Unpin for DocPackageBuilder<'a>
impl<'a> UnwindSafe for DocPackageBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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