Skip to main content

ExportCx

Struct ExportCx 

Source
pub struct ExportCx {
Show 18 fields pub target: String, pub profile: String, pub root: PathBuf, pub workspace: PathBuf, pub target_dir: PathBuf, pub out: PathBuf, pub shown: String, pub release: bool, pub package: String, pub bin: String, pub version: String, pub title: String, pub game: Vec<Work>, pub web: Option<Web>, pub app: Option<AppPart>, pub features: Vec<String>, pub turned_on: Vec<String>, pub beside: Vec<Beside>,
}
Expand description

What an exporter works from.

Fields§

§target: String

The target.

§profile: String

Its profile.

§root: PathBuf

The project’s root.

§workspace: PathBuf

The root of the workspace it builds in.

§target_dir: PathBuf

Cargo’s target folder.

§out: PathBuf

The export’s folder, made.

§shown: String

The export’s folder as the game shows it.

§release: bool

Whether it is a release build.

§package: String

The game’s package.

§bin: String

The program it builds.

§version: String

The game’s version: shuyi.ron’s app.version when it sets one, else the package’s.

§title: String

The game’s title, for NOTICES.txt.

§game: Vec<Work>

The game’s own works for NOTICES.txt.

§web: Option<Web>

The game’s web build, if it has one.

§app: Option<AppPart>

Who the game is, if shuyi.ron says.

§features: Vec<String>

The cargo features of the game’s package.

§turned_on: Vec<String>

The features its build turns on.

§beside: Vec<Beside>

What ships beside the program.

Implementations§

Source§

impl ExportCx

Source

pub fn of( project: &Project, exporter: &dyn Exporter, input: &ExportInput, ) -> Result<Self, ExportError>

The context of exporting project with exporter as input asks: the folder made, the game’s package found with its version and program (cargo metadata --no-deps).

Source

pub fn base(&self) -> String

The package’s name without its extension: <program>-<version>-<target>.

Source

pub fn cargo_args(&self, triple: &str) -> Vec<String>

cargo build’s arguments for the program and triple.

Source

pub fn artifact(&self, triple: &str) -> PathBuf

The path of the program cargo builds for triple.

Source

pub fn needles(&self) -> Vec<PathBuf>

The paths a release package must not hold.

Source

pub fn search(&self, file: &Path) -> Result<(), ExportError>

Refuses file if it holds a path of the build machine (a release build only).

Source

pub fn build( &self, triple: &str, keep_debug: bool, ) -> Result<PathBuf, ExportError>

Builds the program for triple, with its line tables kept and not stripped if keep_debug and it is a release build, and returns the program’s path.

Source

pub fn size(&self, file: &Path) -> Result<FileSize, ExportError>

file’s size, named from the export’s folder.

Source

pub fn report( &self, package: &str, sizes: Vec<FileSize>, signing: Signing, debug: Option<String>, ) -> ExportReport

The report of a package package made from folder (both in the export’s folder), with sizes and signing.

Source

pub fn copy_beside( &self, place: &dyn Fn(bool) -> PathBuf, ) -> Result<Vec<FileSize>, ExportError>

Copies what ships beside the program, each into the folder place picks for it from whether it is a folder, under its name there, and returns what it copied. A name the package already holds is refused.

Source

pub fn mark_beside(&self, report: &ExportReport, shipped: &mut Shipped)

Says in shipped that what report lists as shipped beside the program is the game’s own, for the exposure report.

Source

pub fn native_notices( &self, triple: &str, dir: &Path, ) -> Result<(), ExportError>

Writes NOTICES.txt into dir for a native build for triple: the crates compiled in, the engine’s files they compile in, and the game’s own works.

Trait Implementations§

Source§

impl Clone for ExportCx

Source§

fn clone(&self) -> ExportCx

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExportCx

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ExportCx

Source§

impl PartialEq for ExportCx

Source§

fn eq(&self, other: &ExportCx) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExportCx

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.