include only.Expand description
!include directive — resolver types
(IncludeResolver, IncludeRequest, InputSource,
SymlinkPolicy, SafeFileResolver). Wired into
ParserConfig::include_resolver.
!include directive support — compose YAML documents from
multiple files via the !include path/to/file.yaml tag.
Two layers:
-
includefeature (this module’s free-standing types) — definesIncludeResolver,IncludeRequest, andInputSource. The resolver is aSend + Syncclosure stored oncrate::ParserConfig; users wire it up viacrate::ParserConfig::include_resolver. -
include_fsfeature (SafeFileResolver) — a filesystem-backed implementation with root-dir sandboxing, symlink-policy enforcement (SymlinkPolicy), and max-depth cycle protection.
Fragment anchors (!include file.yaml#name) resolve the named
YAML anchor inside the included document and substitute its
value rather than the whole document. Plain !include file.yaml substitutes the document root.
Cyclic includes (A includes B includes A) are rejected via a
per-resolution visited set; the depth ceiling
crate::ParserConfig::max_include_depth (default 24)
bounds the recursion.
Structs§
- Include
Request - Describes one
!includerequest the loader hands to the resolver. - Include
Resolver - Resolver closure stored on
crate::ParserConfig. - Input
Source - What a resolver returns: the YAML text plus a stable identifier that downstream layers use for cycle detection and span-source attribution.
- Safe
File Resolver include_fs - Filesystem-backed
IncludeResolverwith root-dir sandboxing.
Enums§
- Symlink
Policy - How
SafeFileResolverhandles symbolic links it encounters while resolving a path.
Functions§
- split_
fragment - Split
path#fragmentinto(path, Some(fragment))/(path, None). Used by both the resolver and the post-parse walk so they agree on which characters are path-bytes.