Trait jrsonnet_evaluator::ImportResolver [−][src]
pub trait ImportResolver { fn resolve_file(&self, from: &Path, path: &Path) -> Result<Rc<Path>>; fn load_file_contents(&self, resolved: &Path) -> 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.
fn load_file_contents(&self, resolved: &Path) -> Result<IStr>
fn load_file_contents(&self, resolved: &Path) -> Result<IStr>
Reads file from filesystem, should be used only with path received from resolve_file