Skip to main content

Target

Trait Target 

Source
pub trait Target: Send + Sync {
    // Required methods
    fn descriptor(&self) -> TargetDescriptor;
    fn check(&self, app: &Application, config: &TargetConfig) -> Vec<Diagnostic>;
    fn generate(
        &self,
        app: &Application,
        context: &BuildContext,
    ) -> Result<Vec<GeneratedFile>, Vec<Diagnostic>>;
    fn plan(
        &self,
        app: &Application,
        context: &BuildContext,
    ) -> Result<BuildPlan, Vec<Diagnostic>>;

    // Provided methods
    fn build_hosts(&self) -> &'static [&'static str] { ... }
    fn package(
        &self,
        _app: &Application,
        _context: &BuildContext,
        _signing: &Signing,
    ) -> Result<BuildPlan, Vec<Diagnostic>> { ... }
}
Expand description

A UI target module.

Required Methods§

Source

fn descriptor(&self) -> TargetDescriptor

Source

fn check(&self, app: &Application, config: &TargetConfig) -> Vec<Diagnostic>

Report constructs this target cannot realize, with locations.

Source

fn generate( &self, app: &Application, context: &BuildContext, ) -> Result<Vec<GeneratedFile>, Vec<Diagnostic>>

Generate sources and resources into the output directory.

Source

fn plan( &self, app: &Application, context: &BuildContext, ) -> Result<BuildPlan, Vec<Diagnostic>>

Steps that turn generated files into the final product.

Provided Methods§

Source

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

Operating systems that can build this target, as std::env::consts::OS names them; empty when any can.

Source

fn package( &self, _app: &Application, _context: &BuildContext, _signing: &Signing, ) -> Result<BuildPlan, Vec<Diagnostic>>

Steps that turn a release build, which plan has made, into the packages people install, in dist_dir.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§