pub struct BuildScriptOptions { /* private fields */ }
Expand description

Type to store any (optional) options for the build script.

Implementations§

source§

impl BuildScriptOptions

source

pub fn collect_dependencies(self, collect_dependencies: bool) -> Self

Enables and disables dependency collection.

Dependency data is fairly large, which may cause problems, mainly by crashing the build process. If the project compiles successfully with dependency collection enabled, you are probably fine.

source§

impl BuildScriptOptions

source

pub fn build_timestamp(self, timestamp: DateTime<Utc>) -> Self

Set the build timestamp by hand.

This is mostly important for reproducible builds using only cargo. If possible, consider setting the environment variable SOURCE_DATE_EPOCH instead, which does not require any setup.

source

pub fn build_timestamp_as_nanos(self, nanos: i64) -> Self

Set the build timestamp by hand as nanosecond-precise UNIX timestamp.

This is mostly important for reproducible builds using only cargo. If possible, consider setting the environment variable SOURCE_DATE_EPOCH instead, which does not require any setup.

source§

impl BuildScriptOptions

source

pub fn build(self) -> BuildInfo

Consumes the BuildScriptOptions and returns a BuildInfo object. Use this function if you wish to inspect the generated build information in build.rs.

Trait Implementations§

source§

impl Default for BuildScriptOptions

source§

fn default() -> Self

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

impl Drop for BuildScriptOptions

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<BuildScriptOptions> for BuildInfo

source§

fn from(opts: BuildScriptOptions) -> BuildInfo

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.