Trait jrsonnet_evaluator::ImportResolver[][src]

pub trait ImportResolver {
    fn resolve_file(
        &self,
        from: &PathBuf,
        path: &PathBuf
    ) -> Result<Rc<PathBuf>>;
fn load_file_contents(&self, resolved: &PathBuf) -> Result<IStr>;
unsafe fn as_any(&self) -> &dyn Any; }
Expand description

Implements file resolution logic for import and importStr

Required methods

Resolves real 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.

Reads file from filesystem, should be used only with path received from resolve_file

Safety

For use only in bindings, should not be used elsewhere. Implementations which are not intended to be used in bindings should panic on call to this method.

Implementors