pub struct LoadOptions {
pub lib_root: Option<PathBuf>,
pub fallback_roots: Vec<PathBuf>,
pub version: RustyfiVersion,
pub mode: LoadMode,
pub sources: Option<Box<dyn SourceProvider>>,
}Expand description
Options controlling header resolution.
Implements Default so a call site names only the fields it cares
about: LoadOptions { lib_root: ..., ..Default::default() }. Adding a
field here must keep that spelling working.
Fields§
§lib_root: Option<PathBuf>Root used to resolve @require: name (searched as
<lib_root>/dist/packages/name.{satyh,satyg}, then
<lib_root>/name.{satyh,satyg}, then the nested
<lib_root>/dist/packages/name/name.{satyh,satyg} layout the
Satyrographos installer produces — see resolve::resolve_require).
None means there is no package root configured, so any @require:
header fails to resolve.
fallback_roots: Vec<PathBuf>The REST of the library-root search path, searched in order after
Self::lib_root — a project-local root does not hide the wider ones,
so a document can @require: one package a project installed for
itself and the next from the development tree or the system install.
Empty by default: one named root and nothing behind it.
version: RustyfiVersionThe SATySFi language version the input is expected to conform to.
Defaults to RustyfiVersion::DEFAULT (0.0.6). load rejects any
version for which RustyfiVersion::is_implemented is false before
doing any work.
mode: LoadModeHow dependencies are resolved. Defaults to LoadMode::Legacy.
lib_root/fallback_roots are ignored by the Envelopes backend,
which resolves use … of relative paths and a rustyfi-deps.yaml
envelope graph instead.
sources: Option<Box<dyn SourceProvider>>Where source text comes from. None (the default) is the real
filesystem, FsSources.
Honoured by LoadMode::Legacy only. The Envelopes backend reads
deps/envelope configs through std::fs directly and would silently
ignore this, so load refuses that combination up front rather than
half-applying it.