Struct re_build_info::BuildInfo

source ·
pub struct BuildInfo {
    pub crate_name: &'static str,
    pub version: CrateVersion,
    pub rustc_version: &'static str,
    pub llvm_version: &'static str,
    pub git_hash: &'static str,
    pub git_branch: &'static str,
    pub is_in_rerun_workspace: bool,
    pub target_triple: &'static str,
    pub datetime: &'static str,
}
Expand description

Information about the build of a Rust crate.

Create this with crate::build_info!.

The git_ fields are all empty on failure. Most likely git fails because we’re not in a git repository to begin with, which happens because we’ve imported the published crate from crates.io.

There are a few other cases though, like

  • git is not installed
  • the user downloaded rerun as a tarball and then imported via a path = … import
  • others?

Fields§

§crate_name: &'static str

CARGO_PKG_NAME

§version: CrateVersion

Crate version, parsed from CARGO_PKG_VERSION, ignoring any +metadata suffix.

§rustc_version: &'static str

The raw version string of the Rust compiler used, or an empty string.

§llvm_version: &'static str

The raw version string of the LLVM toolchain used, or an empty string.

§git_hash: &'static str

Git commit hash, or empty string.

§git_branch: &'static str

Current git branch, or empty string.

§is_in_rerun_workspace: bool

True if we are building within the rerun repository workspace.

This is a good proxy for “user checked out the project and built it from source”.

§target_triple: &'static str

Target architecture and OS

Example: xaarch64-apple-darwin

§datetime: &'static str

ISO 8601 / RFC 3339 build time.

Example: "2023-02-23T19:33:26Z"

Empty if unknown.

Implementations§

source§

impl BuildInfo

source

pub fn git_hash_or_tag(&self) -> String

source

pub fn short_git_hash(&self) -> &str

source

pub fn is_final(&self) -> bool

Trait Implementations§

source§

impl Clone for BuildInfo

source§

fn clone(&self) -> BuildInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BuildInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for BuildInfo

For use with e.g. --version

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for BuildInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.