pub struct CreatedAt {
pub package_name: String,
pub package_version: String,
}Expand description
Information on the crate/module where the component was created.
This location matches, for example, where the from! or the f! macro were invoked.
For annotated items (e.g. via #[pavex::config]), this refers to the location of the annotation.
It may be different from the location where the component was registered
with the blueprint—i.e. where a Blueprint method was invoked.
Fields§
§package_name: StringThe name of the crate that created the component, as it appears in the package.name field
of its Cargo.toml.
Obtained via CARGO_PKG_NAME.
In particular, the name has not been normalised—e.g. hyphens are not replaced with underscores.
This information is needed to resolve the import path unambiguously.
E.g. my_crate::module_1::type_2—which crate is my_crate?
This is not obvious due to the possibility of renaming dependencies in Cargo.toml:
[package]
name = "mypackage"
version = "0.0.1"
[dependencies]
my_crate = { version = "0.1", registry = "custom", package = "their_crate" }package_version: StringThe version of the crate that created the component, as it appears in the package.version field
of its Cargo.toml.
Obtained via CARGO_PKG_VERSION.