sphinxcontrib_rust.domain
Module for the rust Sphinx domain for documentation Rust items
Classes
|
The Sphinx domain for the Rust programming language. |
|
An |
- class sphinxcontrib_rust.domain.RustDomain(env: BuildEnvironment)
The Sphinx domain for the Rust programming language.
The domain provides the various roles and directives that can be used in the Sphinx documentation for linking with Rust code.
- clear_doc(docname: str) None
Remove traces of a document in the domain-specific inventories.
- data: dict[str, dict[RustItemType, list[RustItem]] | dict[str, dict[str, str]]]
data value
- data_version = 0
data version, bump this when the format of self.data changes
- directives: dict[str, Type[Directive]] = {'crate': <class 'sphinxcontrib_rust.directives.RustCrateDirective'>, 'enum': <class 'sphinxcontrib_rust.directives.RustEnumDirective'>, 'executable': <class 'sphinxcontrib_rust.directives.RustExecutableDirective'>, 'function': <class 'sphinxcontrib_rust.directives.RustFunctionDirective'>, 'impl': <class 'sphinxcontrib_rust.directives.RustImplDirective'>, 'macro': <class 'sphinxcontrib_rust.directives.RustMacroDirective'>, 'module': <class 'sphinxcontrib_rust.directives.RustModuleDirective'>, 'struct': <class 'sphinxcontrib_rust.directives.RustStructDirective'>, 'trait': <class 'sphinxcontrib_rust.directives.RustTraitDirective'>, 'type': <class 'sphinxcontrib_rust.directives.RustTypeDirective'>, 'use': <class 'sphinxcontrib_rust.directives.RustUseDirective'>, 'variable': <class 'sphinxcontrib_rust.directives.RustVariableDirective'>}
directive name -> directive class
- get_objects() Iterable[tuple[str, str, str, str, str, int]]
Return an iterable of “object descriptions”.
Object descriptions are tuples with six items:
nameFully qualified name.
dispnameName to display when searching/linking.
typeObject type, a key in
self.object_types.docnameThe document where it is to be found.
anchorThe anchor name for the object.
priorityHow “important” the object is (determines placement in search results). One of:
1Default priority (placed before full-text matches).
0Object is important (placed before default-priority objects).
2Object is unimportant (placed after full-text matches).
-1Object should not show up in search at all.
- indices: list[Type[Index]] = [<class 'sphinxcontrib_rust.index.RustIndex'>]
a list of Index subclasses
- initial_data: dict[RustItemType, list[RustItem]] = {'items': {RustItemType.CRATE: [], RustItemType.ENUM: [], RustItemType.EXECUTABLE: [], RustItemType.FUNCTION: [], RustItemType.IMPL: [], RustItemType.MACRO: [], RustItemType.MODULE: [], RustItemType.STRUCT: [], RustItemType.TRAIT: [], RustItemType.TYPE: [], RustItemType.VARIABLE: []}, 'uses': {}}
data value for a fresh environment
- property items: dict[RustItemType, list[RustItem]]
Return the Rust items with in the documentation
- label = 'Rust'
domain label: longer, more descriptive (used in messages)
- merge_domaindata(docnames: list[str], otherdata: dict) None
Merge in data regarding docnames from a different domaindata inventory (coming from a subprocess in parallel builds).
- name = 'rust'
domain name: should be short, but unique
- object_types: dict[str, ObjType] = {'crate': <sphinx.domains.ObjType object>, 'enum': <sphinx.domains.ObjType object>, 'executable': <sphinx.domains.ObjType object>, 'function': <sphinx.domains.ObjType object>, 'impl': <sphinx.domains.ObjType object>, 'macro': <sphinx.domains.ObjType object>, 'module': <sphinx.domains.ObjType object>, 'struct': <sphinx.domains.ObjType object>, 'trait': <sphinx.domains.ObjType object>, 'type': <sphinx.domains.ObjType object>, 'use': <sphinx.domains.ObjType object>, 'variable': <sphinx.domains.ObjType object>}
type (usually directive) name -> ObjType instance
- resolve_any_xref(env: BuildEnvironment, fromdocname: str, builder: Builder, target: str, node: pending_xref, contnode: Element) list[tuple[str, Element]]
Resolve a reference to a Rust item with an unspecified directive type
- resolve_xref(env: BuildEnvironment, fromdocname: str, builder: Builder, typ: str, target: str, node: pending_xref, contnode: Element) Element | None
Resolve a reference to a Rust item with the directive type specified
- roles: dict[str, Callable[[str, str, str, int, Inliner, dict[str, Any], Sequence[str]], tuple[list[Node], list[system_message]]] | XRefRole] = {'crate': <sphinxcontrib_rust.domain.RustXRefRole object>, 'enum': <sphinxcontrib_rust.domain.RustXRefRole object>, 'exe': <sphinxcontrib_rust.domain.RustXRefRole object>, 'executable': <sphinxcontrib_rust.domain.RustXRefRole object>, 'fn': <sphinxcontrib_rust.domain.RustXRefRole object>, 'func': <sphinxcontrib_rust.domain.RustXRefRole object>, 'function': <sphinxcontrib_rust.domain.RustXRefRole object>, 'impl': <sphinxcontrib_rust.domain.RustXRefRole object>, 'macro': <sphinxcontrib_rust.domain.RustXRefRole object>, 'module': <sphinxcontrib_rust.domain.RustXRefRole object>, 'struct': <sphinxcontrib_rust.domain.RustXRefRole object>, 'trait': <sphinxcontrib_rust.domain.RustXRefRole object>, 'type': <sphinxcontrib_rust.domain.RustXRefRole object>, 'use': <sphinxcontrib_rust.domain.RustXRefRole object>, 'var': <sphinxcontrib_rust.domain.RustXRefRole object>, 'variable': <sphinxcontrib_rust.domain.RustXRefRole object>}
role name -> role callable
- property uses: dict[str, dict[str, str]]
Return the dict of use statements per document within the documentation
- class sphinxcontrib_rust.domain.RustXRefRole(fix_parens: bool = False, lowercase: bool = False, nodeclass: type[Element] | None = None, innernodeclass: type[TextElement] | None = None, warn_dangling: bool = False)
An
XRefRoleextension for Rust roles- process_link(env: BuildEnvironment, refnode: Element, has_explicit_title: bool, title: str, target: str) tuple[str, str]
Process the link by parsing the tile and the target