pub struct Info {
pub crate_version: String,
pub crate_features: Vec<String>,
pub build_date: String,
pub build_datetime: String,
pub git: Option<GitInfo>,
}Expand description
Gathered build-time information
This struct contains all the information gathered by bosion. It is not meant to be used
directly under normal circumstances, but is public for documentation purposes and if you wish
to build your own frontend for whatever reason. In that case, note that no effort has been made
to make this usable outside of the build.rs environment.
The git field is only available when the git feature is enabled, and if there is a git
repository to read from. The repository is discovered by walking up the directory tree until one
is found, which means workspaces or more complex monorepos are automatically supported. If there
are any errors reading the repository, the git field will be None and a rustc warning will
be printed.
Fields§
§crate_version: StringThe crate version, as read from the CARGO_PKG_VERSION environment variable.
crate_features: Vec<String>The crate features, as found by the presence of CARGO_FEATURE_* environment variables.
These are normalised to lowercase and have underscores replaced by hyphens.
build_date: StringThe build date, in the format YYYY-MM-DD, at UTC.
This is either current as of build time, or from the timestamp specified by the
SOURCE_DATE_EPOCH environment variable, for
reproducible builds.
build_datetime: StringThe build datetime, in the format YYYY-MM-DD HH:MM:SS, at UTC.
This is either current as of build time, or from the timestamp specified by the
SOURCE_DATE_EPOCH environment variable, for
reproducible builds.
git: Option<GitInfo>Git repository information, if available.
Implementations§
Source§impl Info
impl Info
Sourcepub fn gather() -> Result<Self, String>
pub fn gather() -> Result<Self, String>
Gathers build-time information
This is not meant to be used directly under normal circumstances, but is public if you wish to build your own frontend for whatever reason. In that case, note that no effort has been made to make this usable outside of the build.rs environment.