Struct jrsonnet_evaluator::FileImportResolver
source · pub struct FileImportResolver { /* private fields */ }
Expand description
File resolver, can load file from both FS and library paths
Implementations§
Trait Implementations§
source§impl Default for FileImportResolver
impl Default for FileImportResolver
source§fn default() -> FileImportResolver
fn default() -> FileImportResolver
Returns the “default value” for a type. Read more
source§impl ImportResolver for FileImportResolver
impl ImportResolver for FileImportResolver
source§fn resolve_from(&self, from: &SourcePath, path: &str) -> Result<SourcePath>
fn resolve_from(&self, from: &SourcePath, path: &str) -> Result<SourcePath>
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. Read moresource§fn resolve(&self, path: &Path) -> Result<SourcePath>
fn resolve(&self, path: &Path) -> Result<SourcePath>
Resolves absolute path, doesn’t supports jpath and other fancy things
source§fn load_file_contents(&self, id: &SourcePath) -> Result<Vec<u8>>
fn load_file_contents(&self, id: &SourcePath) -> Result<Vec<u8>>
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