Skip to main content

Resolver

Struct Resolver 

Source
pub struct Resolver {
    pub config: Config,
    /* private fields */
}

Fields§

§config: Config

Implementations§

Source§

impl Resolver

Source

pub fn new(config: Config) -> Self

Source

pub fn offline() -> Self

Core-only resolver: no configuration, only embedded std/core.

Source

pub fn preload(&self, lib: &str, ext: &str, bytes: Vec<u8>)

Supply {lib}.{ext} bytes ahead of resolution. Preloaded sources win over every base layer, so a host can satisfy dependency lookups from memory alone.

Source

pub fn take_missing(&self) -> Vec<(String, String)>

Drain the (lib, ext) pairs whose resolution has failed so far. A host fetches these, preloads them, and retries.

Source

pub fn contains( &self, lib: &str, name: &str, layer1: &[(String, String)], ) -> Result<bool, PipelineError>

Does lib define name?

Source

pub fn def( &self, lib: &str, name: &str, layer1: &[(String, String)], ) -> Result<TypeDef, PipelineError>

The (unlowered) definition of lib’s type name — constraint items plus the type’s default.

Source

pub fn unit_names( &self, lib: &str, layer1: &[(String, String)], ) -> Result<BTreeSet<String>, PipelineError>

The unit names (definitions and aliases) of a .faiv library (SPEC.md § Unit Definition Files), for .!units imports.

Source

pub fn unit_defs( &self, lib: &str, layer1: &[(String, String)], ) -> Result<BTreeMap<String, UnitDef>, PipelineError>

The unit definitions of a .faiv library, for consumers that need the conversion factors themselves (e.g. a query engine scaling custom units to base via crate::unit::scale_with). Same load path and cache as Self::unit_names.

Source

pub fn schema_bytes( &self, lib: &str, layer1: &[(String, String)], ) -> Result<Vec<u8>, PipelineError>

Locate and read {base}/{lib}.{ext} via Layer 1 (.!registry) then Layer 2 (kaiv.kaiv); filesystem bases only. Read a schema source (.saiv) for .!schema inheritance resolution (SPEC.md § Encapsulated Hub Schema Extension).

Source

pub fn csaiv_bytes( &self, lib: &str, layer1: &[(String, String)], ) -> Result<Vec<u8>, PipelineError>

Read a compiled schema (.csaiv) for .!schema validation of a canonical document.

Trait Implementations§

Source§

impl Default for Resolver

Source§

fn default() -> Resolver

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> ErasedDestructor for T
where T: 'static,

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.