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§
Sourcefn profile(&self) -> &'static str
fn profile(&self) -> &'static str
The target profile its check runs with (targets/<profile>.ron).
Sourcefn cargo_args(&self, cx: &ExportCx) -> Vec<Vec<String>>
fn cargo_args(&self, cx: &ExportCx) -> Vec<Vec<String>>
The cargo arguments of each build it runs.
Sourcefn export(&self, cx: &ExportCx) -> Result<ExportReport, ExportError>
fn export(&self, cx: &ExportCx) -> Result<ExportReport, ExportError>
Builds and writes the package into cx.out.
Provided Methods§
Sourcefn builds_a_program(&self) -> bool
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]].
Sourcefn takes_export_part(&self) -> bool
fn takes_export_part(&self) -> bool
Whether shuyi.ron’s export part applies to it.
Sourcefn prepare(
&self,
_cx: &ExportCx,
_project: &Project,
_game: Option<&dyn GameTools>,
) -> Result<(), ExportError>
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.
Sourcefn shipped(&self, cx: &ExportCx, report: &ExportReport) -> Shipped
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".