get

Function get 

Source
pub fn get<S>(name: S) -> Result<PathBuf, BuckResourcesError>
where S: AsRef<str>,
Expand description

Look up a resource based on a manifest file. Built to work seamlessly with resources defined in a rust_binary target, but in principle it would work with any correct manifest file.

Resources follow the naming format:

{PATH_TO_TARGETS_FOLDER}/{TARGET_NAME}

So for //path/to:target, the resource is named path/to/target.

Still unsure about a resource path? Inspect the JSON manifest file found in the BuckResourcesError.

  • Manifest location: $CUR_EXE.resources.json, where $CUR_EXE is the absolute path of the currently executing binary.
  • Relative paths in the manifest are resolved relative to the location of the currently executing binary.