pub struct ResolveConfig {
pub root: PathBuf,
pub max_depth: usize,
pub max_total_includes: usize,
}Expand description
Configuration for the include resolution pass.
Fields§
§root: PathBufDirectory all include paths resolve under. Any include that
canonicalizes outside this root is a IncludeError::RootEscape.
Must be an absolute path. Lexical normalization treats .
and .. against an empty buffer as no-ops; passing a relative
or unnormalized root weakens the root-escape prefix check.
Callers (CLI, LSP) should canonicalize the root before
constructing ResolveConfig.
max_depth: usizeMaximum include depth. Default 8 (see ResolveConfig::DEFAULT_MAX_DEPTH).
Hitting the limit is an error, not a silent truncation.
max_total_includes: usizeMaximum total number of lex.include annotations resolved across
the whole tree (depth × breadth). Default 1000
(see ResolveConfig::DEFAULT_MAX_TOTAL_INCLUDES).
Caps fan-out: max_depth alone bounds chain length but not
breadth. A document with 100 thousand top-level includes at depth
1 sits inside max_depth but can still OOM the resolver / LSP /
CI. Hitting this limit is an error, not a silent truncation.
Implementations§
Source§impl ResolveConfig
impl ResolveConfig
Sourcepub const DEFAULT_MAX_DEPTH: usize = 8
pub const DEFAULT_MAX_DEPTH: usize = 8
Default maximum include depth — enough for any reasonable atomization strategy (aggregator → per-chapter → per-section), bounded enough to keep the resolver’s worst-case work predictable.
Sourcepub const DEFAULT_MAX_TOTAL_INCLUDES: usize = 1000
pub const DEFAULT_MAX_TOTAL_INCLUDES: usize = 1000
Default maximum total include count (DoS bound). Generous enough for a book-length document with thousands of small fragments, tight enough to contain adversarial fan-out within a few seconds of resolver work.
Trait Implementations§
Source§impl Clone for ResolveConfig
impl Clone for ResolveConfig
Source§fn clone(&self) -> ResolveConfig
fn clone(&self) -> ResolveConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ResolveConfig
impl RefUnwindSafe for ResolveConfig
impl Send for ResolveConfig
impl Sync for ResolveConfig
impl Unpin for ResolveConfig
impl UnsafeUnpin for ResolveConfig
impl UnwindSafe for ResolveConfig
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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