1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Compile-time path-hashing and the [`source!`] macro.
/// Compile-time FNV-1a 64-bit hash of a path string (backslashes normalized to forward slashes).
///
/// Used by the [`crate::source!`] macro.
pub const
/// Compile-time reference to an embedded file or directory.
///
/// Create one with the [`crate::source!`] macro, then pass it to
/// [`crate::Installer::file`] or [`crate::Installer::dir`].
;
/// Produce a [`Source`] from a literal path, hashed at compile time.
///
/// The path string itself never appears in the final binary. Paths are
/// relative to the project root as seen by the build tool.
///
/// Accepts optional build-time-only keyword arguments; the values are parsed
/// by the build tool's scanner (not used at runtime). Supported keys:
///
/// - `ignore = ["glob", ...]` — extra glob patterns applied when gathering a
/// directory, merged with the CLI-level `--ignore` list.
/// - `features = ["name", ...]` — cargo-feature gate. The source is only
/// embedded when at least one of the listed features is enabled via
/// `installrs --feature <name>`.
///
/// ```rust,ignore
/// i.file(installrs::source!("assets/config.toml"), "etc/myapp/config.toml")
/// .install()?;
/// i.dir(source!("assets", ignore = ["*.bak", "scratch"]), "assets").install()?;
/// i.file(source!("pro.dat", features = ["pro"]), "pro.dat").install()?;
/// ```