Skip to main content

new

Function new 

Source
pub fn new(info: Info) -> ModuleInfoResult<EmbedArtifacts>
Expand description

One-call entry point: convert InfoPackageMetadata and embed via embed_package_metadata with EmbedOptions::default().

Use this from build.rs when you want to supply metadata programmatically without touching Cargo.toml and don’t need to override any EmbedOptions (custom out_dir, suppressed cargo:rustc-link-arg, …). For those cases, convert Info to PackageMetadata with .into() and call embed_package_metadata directly.

§Errors

Propagates everything embed_package_metadata can return, plus ModuleInfoError::MalformedJson if moduleVersion is not four dot-separated numeric parts that each fit in a u16.