pub struct RegistryExport {
pub nameids: Vec<(String, Option<String>, bool)>,
pub index_serial: u32,
pub program_options: Vec<ProgramOptionRecord>,
pub std_objects: Vec<ObjectRegistration>,
pub py_objects: Vec<PyObjectRecord>,
pub py_modules: Vec<PyModuleRecord>,
pub log_warnings: Vec<ParseLogWarning>,
pub dependencies: Vec<String>,
pub included: Vec<String>,
}Expand description
What the parse layer hands the environment besides the doctree itself:
state that lives in the parser (the docutils id/name registry, Sphinx’s
env.ref_context) and dies with it, but that env collectors need.
Named for its original single job — the document.nameids snapshot
harvested from crate::doctree::ids::IdRegistry right before it drops,
which wave 4’s std-domain label harvest reads. Intended to eventually
ride the document cache, so it stays serde-serializable and cheap to
clone.
Fields§
§nameids: Vec<(String, Option<String>, bool)>(name, id, explicit), one entry per registered name. id is
None once a name has been duplicated away.
index_serial: u32sphinx env.new_serialno('index') counter value at the end of the
parse (shared by the index directive and index-entry-emitting roles).
program_options: Vec<ProgramOptionRecord>The std-domain registrations the object-description directives made while running, in document order.
Sphinx performs these from inside add_target_and_index, against
state the finished doctree does not carry: the program an option
belongs to comes from env.ref_context['std:program'] and is
stamped on no node, and a :no-typesetting: description registers
itself and then replaces its whole desc node with a bare
target — so a doctree walk can neither recover the program nor see
that the object existed. Recording the calls keeps the env layer
exact for both.
Deliberately not #[serde(default)], for the reason
crate::document::Document::registry gives: a cache entry written
before this field existed must FAIL to decode so the document is
re-parsed. Defaulting it to an empty vector would let a pre-desc
cache decode cleanly, and every :option:/:envvar:/:confval:
in the project would then dangle against an empty registry.
std_objects: Vec<ObjectRegistration>See Self::program_options — including why this is not
#[serde(default)] either.
py_objects: Vec<PyObjectRecord>The py-domain object registrations (PythonDomain.note_object), in
document order. Same rationale and cache-shape rule as
Self::program_options: the program state analog here is the
parser’s py:module/py:class ref_context, which no doctree node
carries, and a :no-typesetting: py object registers and then
vanishes from the tree.
py_modules: Vec<PyModuleRecord>The py-domain module registrations (PythonDomain.note_module), in
document order. Not #[serde(default)] — see
Self::program_options.
log_warnings: Vec<ParseLogWarning>Diagnostics the parse raised through Sphinx’s logger rather than
into the tree, which have nowhere else to go: docutils turns a
directive error into a system_message node, but a Sphinx directive
calling logger.warning produces no node at all. They ride the
export (and therefore the document cache) for the same reason
ToctreeRecord::warnings does — a cache hit that skipped the parse
must still reproduce them.
dependencies: Vec<String>Files the document pulls in at parse time (docutils
settings.record_dependencies, harvested by sphinx’s
DependenciesCollector): one srcdir-relative normalized path per
successfully opened include target — non-doc files included,
standard includes excluded (§Scope-2b). The env layer replays these
into env.dependencies, which drives get_outdated_files. Not
#[serde(default)] — see Self::program_options: a pre-include
cache decoding with an empty list would never re-read the document
when an included file changes.
included: Vec<String>The docnames this document textually includes (sphinx
env.note_included, recorded for every include argument that maps
to a docname — before the file is even opened, like sphinx). The
env layer replays these into env.included, whose only consumer is
the orphan check. Not #[serde(default)] — see
Self::program_options.
Trait Implementations§
Source§impl Clone for RegistryExport
impl Clone for RegistryExport
Source§fn clone(&self) -> RegistryExport
fn clone(&self) -> RegistryExport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RegistryExport
impl Debug for RegistryExport
Source§impl Default for RegistryExport
impl Default for RegistryExport
Source§fn default() -> RegistryExport
fn default() -> RegistryExport
Source§impl<'de> Deserialize<'de> for RegistryExport
impl<'de> Deserialize<'de> for RegistryExport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RegistryExport
impl RefUnwindSafe for RegistryExport
impl Send for RegistryExport
impl Sync for RegistryExport
impl Unpin for RegistryExport
impl UnsafeUnpin for RegistryExport
impl UnwindSafe for RegistryExport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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