pub struct Builder { /* private fields */ }Expand description
Builder for generating environment/configuration variables.
Implementations§
Source§impl Builder
impl Builder
Sourcepub const fn lenient_clean(self) -> Self
pub const fn lenient_clean(self) -> Self
Categorize as a “clean” build only by checking for uncommitted changes.
By default a clean build requires both no uncommitted changes as well as no untracked files.
Sourcepub fn detect_tagged<F>(self, f: F) -> Self
pub fn detect_tagged<F>(self, f: F) -> Self
Register a closure to be called to determine if a “tagged build” tag is present.
Sourcepub fn build(self) -> Status
pub fn build(self) -> Status
Set up build environment/cfg variables.
§Environment variables
FSL_PRJCODE- The repository project code.FSL_PRJNAME- The repository project name.FSL_CHECKOUT_HASH- The checkout’s last commit hash.FSL_CHECKOUT_TS- The checkout’s last commit timestamp.FSL_CHECKOUT- Set todirtyif the worktree contains uncommitted changes or untracked files. Set tocleanotherwise.FSL_TAGGED- Set to the tag name if this is a “tagged build”. Not set if this isn’t a tagged build.
§cfg variables
fsl_tagged
Only set if this is a “tagged build”.fsl_checkout="clean"|"dirty"
§Panics
Because this is intended to be used from a build script, all errors are turned into panics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl !Send for Builder
impl !Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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