Layout

Trait Layout 

Source
pub trait Layout {
    // Required methods
    fn name(&self) -> &Name;
    fn root(&self) -> &Path;

    // Provided methods
    fn dest(&self) -> Cow<'_, Path> { ... }
    fn assets(&self) -> Cow<'_, Path> { ... }
    fn assets_hash(&self) -> Cow<'_, Path> { ... }
    fn assets_plan(&self) -> Cow<'_, Path> { ... }
    fn build(&self) -> Cow<'_, Path> { ... }
    fn manifest(&self) -> Cow<'_, Path> { ... }
    fn binary(&self) -> Cow<'_, Path> { ... }
    fn library(&self) -> Cow<'_, Path> { ... }
    fn artifact(&self) -> Cow<'_, Path> { ... }
    fn prepare(&mut self) -> Result<()> { ... }
}

Required Methods§

Source

fn name(&self) -> &Name

Source

fn root(&self) -> &Path

The root directory: /path/to/target/profile/playdate. If per-target: /path/to/target/$TRIPLE/profile/playdate. If build-script: /path/to/target(/$TRIPLE)/profile/build/**/out ($OUT_DIR or export-dir).

Provided Methods§

Source

fn dest(&self) -> Cow<'_, Path>

The intermediate artifact destination: $root/$NAME/

Crate can have multiple targets (e.g. bins, lib, examples), so we’re have to specify the name, so dest will be $root/$NAME/, where $NAME is the name of the target.

Source

fn assets(&self) -> Cow<'_, Path>

Collected assets

Source

fn assets_hash(&self) -> Cow<'_, Path>

Hash of collected assets: $dest/.assets.hash

Source

fn assets_plan(&self) -> Cow<'_, Path>

Source

fn build(&self) -> Cow<'_, Path>

The directory for build package: $dest/build

Directory with all files prepared to build with pdc.

Contains:

  • pdex.elf : by cargo (+gcc) (link)
  • pdex.dylib : by cargo (link)
  • pdxinfo : manifest
    • files : linked assets
Source

fn manifest(&self) -> Cow<'_, Path>

Playdate package manifest: $build/pdxinfo

Source

fn binary(&self) -> Cow<'_, Path>

Playdate (hw) executable: $build/pdex.elf

Source

fn library(&self) -> Cow<'_, Path>

Playdate (sim) library: $build/pdex.(dylib|dll)

Type of library depends on the current (HOST) target.

Source

fn artifact(&self) -> Cow<'_, Path>

The final package: $root/$NAME.pdx

Source

fn prepare(&mut self) -> Result<()>

Create all directories.

Implementors§