Skip to main content

Outcome

Struct Outcome 

Source
#[non_exhaustive]
pub struct Outcome { pub manifest_hash: u64, pub report: Report, pub locales: Vec<LocaleInfo>, pub source_locale: String, pub written: Vec<PathBuf>, pub removed: Vec<PathBuf>, pub generated: String, pub catalogs_module: String, pub out_dir: PathBuf, /* private fields */ }
Expand description

What a build produced.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§manifest_hash: u64

Its hash — what the wasm and every catalog agree on.

§report: Report

Everything the build has to say.

§locales: Vec<LocaleInfo>

The locale table the generated module carries.

§source_locale: String

The source locale.

§written: Vec<PathBuf>

The files whose bytes changed (and were written).

§removed: Vec<PathBuf>

Old catalogs removed.

§generated: String

The generated Rust module’s source.

§catalogs_module: String

The catalog table’s source, when the build emits it apart (Emit::Catalogs); empty otherwise.

§out_dir: PathBuf

Where the outputs went.

Implementations§

Source§

impl Outcome

Source

pub fn is_clean(&self) -> bool

Whether the corpus had no errors.

Source

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

The outcome if the corpus was clean, else the error a build script fails with — the report is printed before it, as warnings and errors.

Source

pub fn publish(&self, dir: &Path) -> Result<Published>

Writes what a static host serves into dir: every catalog under its content-hashed name (with its .br and .gz, when the build compressed them) and index.json, {"<tag>": "<file name>", …}, which a client-only application reads to find them. Nothing else — not the manifest, not the generated module — so the whole directory can be published as it is. Catalogs an earlier publish left in dir are removed; each file is written only when its bytes change.

The catalogs are immutable and may be cached forever; the index is not, and a host should serve it no-cache.

Trait Implementations§

Source§

impl Debug for Outcome

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.