DocPackageBuilder

Struct DocPackageBuilder 

Source
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: String

Implementations§

Source§

impl<'a> DocPackageBuilder<'a>

Source

pub fn new(stub_info: &'a StubInfo) -> Self

Source

fn create_context<'b>(&'b self, module: &'b str) -> DocBuildContext<'b>

Create a build context for a specific module

Source

pub fn build(self) -> Result<DocPackage>

Source

fn build_module(&self, name: &str, module: &Module) -> Result<DocModule>

Source

fn build_function( &self, module: &str, func_defs: &[FunctionDef], ) -> Result<DocItem>

Source

fn build_signature_from_params( &self, module: &str, parameters: &Parameters, return_type: &TypeInfo, ) -> Result<DocSignature>

Source

fn build_signature( &self, module: &str, def: &FunctionDef, ) -> Result<DocSignature>

Source

fn build_signature_from_method( &self, module: &str, def: &MethodDef, ) -> Result<DocSignature>

Source

fn build_type_alias( &self, module: &str, alias: &TypeAliasDef, ) -> Result<DocItem>

Source

fn build_class(&self, module: &str, class: &ClassDef) -> Result<DocItem>

Source

fn build_enum_as_class( &self, _module: &str, enum_def: &EnumDef, ) -> Result<DocItem>

Source

fn build_variable(&self, module: &str, var: &VariableDef) -> Result<DocItem>

Source

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

Correct link targets in a re-exported item to point to the target module

Source

fn correct_type_expr(&self, type_expr: &mut DocTypeExpr)

Correct a type expression to use export_map for link targets

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Ungil for T
where T: Send,