Expand description
§cargo-packager-resource-resolver
Resource resolver for apps that were packaged by cargo-packager
.
It resolves the root path which contains resources, which was set using the resources
field of cargo packager configuration.
§Get the resource path
use cargo_packager_resource_resolver::{resources_dir, PackageFormat};
let resource_path = resources_dir(PackageFormat::Nsis).unwrap();
§Automatically detect formats
This feature is only available for apps that were built with cargo packager. So the node js binding will not work.
- Make sure to use the
before_each_package_command
field of cargo packager configuration to build your app (this will not work with thebefore_packaging_command
field). - Active the feature
auto-detect-format
.
use cargo_packager_resource_resolver::{resources_dir, current_format};
let resource_path = resources_dir(current_format()).unwrap();
Enums§
- The error type of
resource-resolver
. - Types of supported packages by
cargo-packager
.
Functions§
- Get the current package format. Can only be used if the app was build with cargo-packager and when the
before-each-package-command
Cargo feature is enabled. - Retrieve the resource path of your app, packaged with cargo packager.