Crate cargo_resources

Crate cargo_resources 

Source
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§

ResourceDataDeclaration
The structure matching the resource declaration (provides) in the package metadata.
ResourceSpecification
The fully populated resource specification (derived from a crate’s resource declaration).

Enums§

ResourceEncoding
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§

ResourceName
The Resource Name
ResourceSha
The Resource’s SHA 256 Value