pub trait ImportResolver: Trace {
    fn load_file_contents(&self, resolved: &SourcePath) -> Result<Vec<u8>>;
    fn as_any(&self) -> &dyn Any;

    fn resolve_from(&self, from: &SourcePath, path: &str) -> Result<SourcePath> { ... }
    fn resolve_from_default(&self, path: &str) -> Result<SourcePath> { ... }
    fn resolve(&self, path: &Path) -> Result<SourcePath> { ... }
}
Expand description

Implements file resolution logic for import and importStr

Required Methods§

Load resolved file This should only be called with value returned from [ImportResolver::resolve_file]/ImportResolver::resolve, this cannot be resolved using associated type, as evaluator uses object instead of generic for ImportResolver

For downcasts

Provided Methods§

Resolves file path, e.g. (/home/user/manifests, b.libjsonnet) can correspond both to /home/user/manifests/b.libjsonnet and to /home/user/${vendor}/b.libjsonnet where ${vendor} is a library path.

from should only be returned from ImportResolver::resolve, or from other defined file, any other value may result in panic

Resolves absolute path, doesn’t supports jpath and other fancy things

Trait Implementations§

Returns the “default value” for a type. Read more

Implementors§