pub struct BuildInfo {
pub name: &'static str,
pub version: &'static str,
pub commit: Option<&'static str>,
pub built_at: Option<&'static str>,
pub profile: &'static str,
}Expand description
The identity of a running binary.
Build it with build_info!, which fills it in from the crate being
compiled.
Every field is &'static str, because every value is known when the binary
is — so this costs nothing to hold and nothing to clone. That is also why
it is Serialize and not Deserialize: a service reads its own build
info, and a client reading somebody else’s wants its own owned type.
Fields§
§name: &'static strThe package name.
version: &'static strThe package version.
commit: Option<&'static str>The commit this was built from, if the build was told.
built_at: Option<&'static str>When it was built, if the build was told.
profile: &'static strdebug or release.
Implementations§
Source§impl BuildInfo
impl BuildInfo
Sourcepub fn short_commit(&self) -> Option<&str>
pub fn short_commit(&self) -> Option<&str>
The commit, shortened to the first seven characters.
What everybody actually pastes into a chat message.
Trait Implementations§
impl Eq for BuildInfo
impl StructuralPartialEq for BuildInfo
Auto Trait Implementations§
impl Freeze for BuildInfo
impl RefUnwindSafe for BuildInfo
impl Send for BuildInfo
impl Sync for BuildInfo
impl Unpin for BuildInfo
impl UnsafeUnpin for BuildInfo
impl UnwindSafe for BuildInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more