pub struct BuildInfo {
pub version: String,
pub commit: Option<String>,
pub date: Option<String>,
}Expand description
Build metadata shown by the root --version flag.
Fields§
§version: StringSemantic version or other release label.
commit: Option<String>Optional source control commit identifier.
date: Option<String>Optional build date string.
Implementations§
Source§impl BuildInfo
impl BuildInfo
Sourcepub fn new(version: impl Into<String>) -> Self
pub fn new(version: impl Into<String>) -> Self
Creates build metadata with only a version string.
Sourcepub fn with_commit(self, commit: impl Into<String>) -> Self
pub fn with_commit(self, commit: impl Into<String>) -> Self
Adds a commit identifier to the version string shown by --version.
Sourcepub fn with_date(self, date: impl Into<String>) -> Self
pub fn with_date(self, date: impl Into<String>) -> Self
Adds a build date to the version string shown by --version.
Sourcepub fn version_string(&self) -> String
pub fn version_string(&self) -> String
Returns the rendered version string used by the root --version flag.
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