pub struct Gix { /* private fields */ }Expand description
The VERGEN_GIT_* configuration features
| Variable | Sample |
|---|---|
VERGEN_GIT_BRANCH | feature/fun |
VERGEN_GIT_COMMIT_AUTHOR_EMAIL | janedoe@email.com |
VERGEN_GIT_COMMIT_AUTHOR_NAME | Jane Doe |
VERGEN_GIT_COMMIT_COUNT | 330 |
VERGEN_GIT_COMMIT_DATE | 2021-02-24 |
VERGEN_GIT_COMMIT_MESSAGE | feat: add commit messages |
VERGEN_GIT_COMMIT_TIMESTAMP | 2021-02-24T20:55:21+00:00 |
VERGEN_GIT_DESCRIBE | 5.0.0-2-gf49246c |
VERGEN_GIT_SHA | f49246ce334567bff9f950bfd0f3078184a2738a |
VERGEN_GIT_DIRTY | true |
§Example
let gix = GixBuilder::all_git()?;
Emitter::default().add_instructions(&gix)?.emit()?;Override output with your own value
temp_env::with_var("VERGEN_GIT_BRANCH", Some("this is the branch I want output"), || {
let result = || -> Result<()> {
let gix = GixBuilder::all_git()?;
Emitter::default().add_instructions(&gix)?.emit()?;
Ok(())
}();
});Implementations§
Trait Implementations§
Source§impl Add for Gix
impl Add for Gix
Source§fn add_map_entries(
&self,
idempotent: bool,
cargo_rustc_env: &mut CargoRustcEnvMap,
cargo_rerun_if_changed: &mut CargoRerunIfChanged,
cargo_warning: &mut CargoWarning,
) -> Result<()>
fn add_map_entries( &self, idempotent: bool, cargo_rustc_env: &mut CargoRustcEnvMap, cargo_rerun_if_changed: &mut CargoRerunIfChanged, cargo_warning: &mut CargoWarning, ) -> Result<()>
Try to add instructions entries to the various given arguments. Read more
Source§fn add_default_entries(
&self,
config: &DefaultConfig,
cargo_rustc_env_map: &mut CargoRustcEnvMap,
cargo_rerun_if_changed: &mut CargoRerunIfChanged,
cargo_warning: &mut CargoWarning,
) -> Result<()>
fn add_default_entries( &self, config: &DefaultConfig, cargo_rustc_env_map: &mut CargoRustcEnvMap, cargo_rerun_if_changed: &mut CargoRerunIfChanged, cargo_warning: &mut CargoWarning, ) -> Result<()>
Based on the given configuration, emit either default idempotent output or generate a failue. Read more
impl StructuralPartialEq for Gix
Auto Trait Implementations§
impl Freeze for Gix
impl RefUnwindSafe for Gix
impl Send for Gix
impl Sync for Gix
impl Unpin for Gix
impl UnwindSafe for Gix
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