Skip to main content

Build

Struct Build 

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

A build, configured.

Implementations§

Source§

impl Build

Source

pub fn new() -> Result<Build>

A build of the crate cargo is compiling: CARGO_MANIFEST_DIR for the corpus, OUT_DIR for the outputs.

Source

pub fn at(root: impl Into<PathBuf>, out_dir: impl Into<PathBuf>) -> Build

A build of the corpus at root, writing to out_dir.

Source

pub fn source_locale(self, locale: impl Into<String>) -> Build

Overrides mf2.toml’s source_locale.

Source

pub fn config(self, config: Config) -> Build

Uses this configuration instead of reading mf2.toml.

Source

pub fn features(self, features: Features) -> Build

Uses this feature set instead of reading CARGO_FEATURE_*.

Source

pub fn facade(self, path: impl Into<String>) -> Build

The crate path the generated module re-exports as __mf2 (::mf2). A test with a stub facade names its own.

Source

pub fn emit(self, emit: Emit) -> Build

What to write (the default is Emit::Both).

Source

pub fn emit_cargo(self, emit: bool) -> Build

Prints cargo::rerun-if-changed and cargo::warning lines.

Source

pub fn manifest_inline(self, inline: bool) -> Build

Bakes the manifest’s bytes into the tr! wrapper instead of its path (plans/05-tooling.md §4): every expansion is then independent of where the target directory lives, which is what remote execution and a relocated CI cache need. It costs macro time and manifest size × call sites in the generated module, so it is opt-in (P0.9: +0.5 s per 2,000 sites).

Source

pub fn run(self) -> Result<Outcome>

Runs the whole pipeline and writes the outputs.

Source

pub fn check(self) -> Result<Outcome>

Runs everything but writes nothing — mf2 check.

Trait Implementations§

Source§

impl Debug for Build

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Build

§

impl RefUnwindSafe for Build

§

impl Send for Build

§

impl Sync for Build

§

impl Unpin for Build

§

impl UnsafeUnpin for Build

§

impl UnwindSafe for Build

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> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.