Skip to main content

ParseOptions

Struct ParseOptions 

Source
pub struct ParseOptions {
    pub source_path: String,
    pub sphinx: bool,
    pub docname: String,
    pub found_docs: Option<Arc<BTreeSet<String>>>,
    pub exclude_patterns: Vec<String>,
    pub py: PySigConfig,
    pub srcdir: Option<PathBuf>,
    pub source_encoding: String,
}

Fields§

§source_path: String

What <document source="..."> prints (docutils new_document name).

§sphinx: bool

Sphinx mode: the Sphinx directive/role registries extend the docutils-native ones (toctree, xref roles, …). The binary build path runs with this on; the docutils differential fixture off.

§docname: String

The docname recorded on pending_xref nodes (sphinx refdoc).

§found_docs: Option<Arc<BTreeSet<String>>>

Every docname the project discovered (sphinx env.found_docs). The toctree directive resolves its entries against this set at parse time, exactly as Sphinx’s TocTree.parse_content does.

None means “parsed without an environment” — a standalone parse (the differential harnesses, parse_rst callers) where no document exists, so every toctree entry resolves to nothing and entries/ includefiles stay empty. Shared by Arc because the build clones these options once per source file.

§exclude_patterns: Vec<String>

exclude_patterns, which TocTree.parse_content consults to tell an excluded toctree target from a nonexisting one. Empty for a parse without an environment, where no entry resolves anyway.

§py: PySigConfig

The object-signature / py-domain configuration the read phase consumes (crate::py::PySigConfig): today the fix_parens roles’ add_function_parentheses, and from the py directives onward the signature-wrapping and TOC-entry keys too. Defaults to sphinx’s own defaults, so a parse without a project behaves like a default one.

§srcdir: Option<PathBuf>

The project source directory (sphinx env.srcdir), which the include directive’s sphinx-mode path rewrite resolves against (sphinx/directives/other.py:413-416 runs env.relfn2path on every include argument before docutils sees it) and which the parse-time included/dependencies records are spelled relative to.

None — the default — means “parsed without a project”: include arguments then resolve the docutils way, relative to the directory of the containing file, and no records are made. Standalone parses (the differential harnesses, parse_rst callers) keep their current behavior.

§source_encoding: String

Sphinx’s source_encoding config value (config.py:244, default 'utf-8-sig'), which the environment copies onto settings.input_encoding (environment/__init__.py:375). In sphinx mode both file-inserting directives read it as their default: include through settings.input_encoding (misc.py:116) and literalinclude through config.source_encoding (code.py:210); an explicit :encoding: option still wins. Ignored outside sphinx mode, where bare docutils’ 'utf-8' default applies.

Trait Implementations§

Source§

impl Clone for ParseOptions

Source§

fn clone(&self) -> ParseOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParseOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ParseOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.