Skip to main content

LoadOptions

Struct LoadOptions 

Source
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: RustyfiVersion

The 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: LoadMode

How 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.

Trait Implementations§

Source§

impl Default for LoadOptions

Source§

fn default() -> LoadOptions

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> 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, 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.