pub trait ContextResolver {
// Required method
fn resolve(
&self,
binding: &BindingFile,
project_dir: &Path,
) -> Result<Box<dyn ContextLoader>, String>;
}Expand description
Turns a parsed context/binding.yml into the ContextLoader the compiler probes.
The counterpart of ComponentSource for context: components could already be supplied by a
host, context could not. A host implements this to bind a semantic layer this checkout cannot
read itself — one held by a service, for instance — without warble learning anything about it.
A resolver is free to do no I/O at all, and warble compile must stay runnable offline and
without credentials. A host binding a remote layer is expected to resolve from a snapshot it
pulled earlier, or to return a loader that declines the schema probes
(ContextLoader::can_answer) rather than reaching for the network mid-compile.
Required Methods§
Sourcefn resolve(
&self,
binding: &BindingFile,
project_dir: &Path,
) -> Result<Box<dyn ContextLoader>, String>
fn resolve( &self, binding: &BindingFile, project_dir: &Path, ) -> Result<Box<dyn ContextLoader>, String>
Build the loader for binding. project_dir is the Warble project directory, so a resolver
reading from disk can resolve a relative binding.project against it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".