#detail #pkg #pkg-details

pkg-details

A way to register package details for dependencies

3 releases

Uses new Rust 2024

new 0.1.2 May 7, 2025
0.1.1 May 7, 2025
0.1.0 May 7, 2025

#9 in #pkg

24 downloads per month
Used in arc-metrics

MIT license

3KB

pkg-details

Why does this exist?

Sometimes dependencies want to know what the application's package name and version is. Think logging or metric libraries. This crate provides a way for the application to register its details so downstream dependencies can read them.

Usage

fn main() {
    pkg_details::init!();
}


## In a library / dependency

fn setup_logging() {
    let details = pkg_details::get();
    println!("Starting logging, pkg: {}, version: {}", details.pkg_name, details.pkg_version);
}

No runtime deps