pub struct IncludesConfig {
pub root: Option<String>,
pub max_depth: usize,
pub max_total_includes: usize,
pub max_file_size: u64,
}Expand description
Include-resolution options consumed by lexd convert, lexd inspect,
and the LSP. lexd format never expands includes regardless.
Fields§
§root: Option<String>Resolution root for include path resolution.
All include paths — relative or root-absolute (/...) — must
lexically normalize inside this directory. Outside-the-root paths
fail with a RootEscape error. (The resolver does not call
std::fs::canonicalize; symlink-aware canonicalization is the
loader’s responsibility, not the resolver’s.)
When None (default), the CLI discovers the root by walking up
from the entry-point document to find the nearest .lex.toml,
falling back to the entry-point’s own directory.
max_depth: usizeMaximum include depth. Default 8. Hitting the limit is an error, not a silent truncation.
max_total_includes: usizeMaximum total include count across the document (DoS bound).
Default 1000. Caps fan-out — max_depth alone bounds chain
length but a doc with thousands of includes at depth 1 still
blows past it.
max_file_size: u64Maximum size of any single included file in bytes (DoS bound).
Default 10 MiB (10485760). Files larger than this are rejected
before any bytes hit memory. Used by FsLoader; the in-memory
MemoryLoader doesn’t enforce a size limit.
Trait Implementations§
Source§impl Clone for IncludesConfig
impl Clone for IncludesConfig
Source§fn clone(&self) -> IncludesConfig
fn clone(&self) -> IncludesConfig
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 IncludesConfig
impl Debug for IncludesConfig
Source§impl<'de> Deserialize<'de> for IncludesConfig
impl<'de> Deserialize<'de> for IncludesConfig
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>,
Source§impl Schema for IncludesConfig
impl Schema for IncludesConfig
Source§const STATIC: &'static SchemaStatic
const STATIC: &'static SchemaStatic
static SchemaStatic = ... initializers.Source§fn schema() -> &'static Schema
fn schema() -> &'static Schema
OnceLock; the helper cached_runtime_schema keeps the
generated body small.Source§fn schema_arc() -> Arc<Schema>
fn schema_arc() -> Arc<Schema>
Arc-flavored access to the same cached runtime view. Used by the
macro-driven builder (crate::SchemaConfigBuilder) to avoid
cloning the schema tree per builder construction — the runtime
spec stores an Arc<Schema> and the cache hands out cheap
reference-counted handles to it. Cost: one Arc::clone per call
(atomic increment, no allocation).Source§fn schema_static() -> &'static SchemaStatic
fn schema_static() -> &'static SchemaStatic
Self::STATIC.Source§fn field_paths() -> Vec<String>
fn field_paths() -> Vec<String>
--list-keys flags) replace hand-maintained “known paths”
constants — the macro recomputes the list every time a field is
added or removed. Read moreAuto Trait Implementations§
impl Freeze for IncludesConfig
impl RefUnwindSafe for IncludesConfig
impl Send for IncludesConfig
impl Sync for IncludesConfig
impl Unpin for IncludesConfig
impl UnsafeUnpin for IncludesConfig
impl UnwindSafe for IncludesConfig
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> 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