Expand description
Cargo Resources provides a cargo command line tool and library (i.e. this module), to help declare and collate resources within Cargo Crates.
Usage:
use std::env::current_dir;
use cargo_metadata::camino::Utf8PathBuf;
use cargo_resources::*;
use std::error::Error;
use cargo_resources::reporting::BuildRsReporter;
let cwd = current_dir().unwrap();
let manifest_file = Utf8PathBuf::from_path_buf(cwd).unwrap().join("Cargo.toml");
// Collate resources from the crate's dependencies.
let _r = collate_resources(&manifest_file);
// or using build.rs formatted output.
let reporter = BuildRsReporter{};
let _r = collate_resources_with_reporting(&manifest_file, &reporter);Modules§
- reporting
- Provide better and configurable reporting of resource collection. This allows finer control when using in a build script (i.e. build.rs file).
Structs§
- Resource
Data Declaration - The structure matching the resource declaration (provides) in the package metadata.
- Resource
Specification - The fully populated resource specification (derived from a crate’s resource declaration).
Enums§
- Resource
Encoding - What sort of file encoding the resource is using (i.e. text or binary)
Functions§
- collate_
resources - Collate the resources for the given crate, into the crate.
- collate_
resources_ with_ crate_ filter - Collate the resources for the given crate, into the crate.
- collate_
resources_ with_ reporting - Collate the resources for the given crate, into the crate.
Type Aliases§
- Resource
Name - The Resource Name
- Resource
Sha - The Resource’s SHA 256 Value