55//! but we want to ship a single executable. `materialized_artifact` embeds
66//! the file content as a `&'static [u8]` at compile time via the
77//! [`artifact!`] macro (same as `include_bytes!`), and
8- //! [`Artifact::ensure_in `] writes it out to disk when first needed — that
8+ //! [`Artifact::materialize_in `] writes it out to disk when first needed — that
99//! materialization step is the value-add over a bare `include_bytes!`.
1010//!
1111//! Materialized files are named `{name}_{hash}{suffix}` in the caller-chosen
1212//! directory. The hash (computed at build time by
1313//! `materialized_artifact_build::register`) gives three properties without
1414//! any coordination between processes:
1515//!
16- //! - **No repeated writes.** [`Artifact::ensure_in `] returns the existing
16+ //! - **No repeated writes.** [`Artifact::materialize_in `] returns the existing
1717//! path if the file is already there; repeated calls and re-runs skip I/O.
1818//! - **Correctness.** Two binaries with different embedded content produce
1919//! different filenames, so a stale file from an older build is never
@@ -29,7 +29,7 @@ use std::{
2929} ;
3030
3131/// A file embedded into the executable at compile time. Construct with
32- /// [`artifact!`]; materialize to disk with [`Artifact::ensure_in `]. See the
32+ /// [`artifact!`]; materialize to disk with [`Artifact::materialize_in `]. See the
3333/// [crate docs] for the design rationale.
3434///
3535/// [crate docs]: crate
@@ -82,7 +82,7 @@ impl Artifact {
8282 /// Returns an error if the directory can't be read/written, the stat
8383 /// fails for any reason other than not-found, or the temp-file rename
8484 /// fails and the destination still doesn't exist.
85- pub fn ensure_in (
85+ pub fn materialize_in (
8686 & self ,
8787 dir : impl AsRef < Path > ,
8888 suffix : & str ,
0 commit comments