Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }
Expand description

Builder for generating environment/configuration variables.

Implementations§

Source§

impl Builder

Source

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.

Source

pub fn detect_tagged<F>(self, f: F) -> Self
where F: Fn(&str) -> bool + 'static,

Register a closure to be called to determine if a “tagged build” tag is present.

Source

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 to dirty if the worktree contains uncommitted changes or untracked files. Set to clean otherwise.
  • 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§

Source§

impl Default for Builder

Source§

fn default() -> Builder

Returns the “default value” for a type. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.