Skip to main content

Exporter

Trait Exporter 

Source
pub trait Exporter: Sync {
    // Required methods
    fn id(&self) -> &'static str;
    fn profile(&self) -> &'static str;
    fn triples(&self) -> &'static [&'static str];
    fn cargo_args(&self, cx: &ExportCx) -> Vec<Vec<String>>;
    fn export(&self, cx: &ExportCx) -> Result<ExportReport, ExportError>;

    // Provided methods
    fn builds_a_program(&self) -> bool { ... }
    fn takes_export_part(&self) -> bool { ... }
    fn prepare(
        &self,
        _cx: &ExportCx,
        _project: &Project,
        _game: Option<&dyn GameTools>,
    ) -> Result<(), ExportError> { ... }
    fn shipped(&self, cx: &ExportCx, report: &ExportReport) -> Shipped { ... }
    fn run(&self, _cx: &RunCx<'_>) -> Result<(), ExportError> { ... }
}
Expand description

A target’s exporter.

Required Methods§

Source

fn id(&self) -> &'static str

The target’s id: shuyi export <id>.

Source

fn profile(&self) -> &'static str

The target profile its check runs with (targets/<profile>.ron).

Source

fn triples(&self) -> &'static [&'static str]

The Rust triples it builds for.

Source

fn cargo_args(&self, cx: &ExportCx) -> Vec<Vec<String>>

The cargo arguments of each build it runs.

Source

fn export(&self, cx: &ExportCx) -> Result<ExportReport, ExportError>

Builds and writes the package into cx.out.

Provided Methods§

Source

fn builds_a_program(&self) -> bool

Whether it packages a program of the game’s package; otherwise it builds the package’s library, and the package needs no [[bin]].

Source

fn takes_export_part(&self) -> bool

Whether shuyi.ron’s export part applies to it.

Source

fn prepare( &self, _cx: &ExportCx, _project: &Project, _game: Option<&dyn GameTools>, ) -> Result<(), ExportError>

What it needs of the game’s tools before it builds, run where they are at hand: by default nothing.

Source

fn shipped(&self, cx: &ExportCx, report: &ExportReport) -> Shipped

What the export that answered report wrote and where, for the inspection after it. By default the folder and archive report names and no file known, so a target that doesn’t say holds only undeclared files.

Source

fn run(&self, _cx: &RunCx<'_>) -> Result<(), ExportError>

Runs the package export wrote: by default there is no run step.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§