Task

Trait Task 

Source
pub trait Task {
    type Context;
    type Error;

    // Required methods
    fn verb(&self) -> &str;
    fn message(&self) -> &str;
    fn detail(&self) -> &str;
    fn run(
        &self,
        context: Self::Context,
        manager: &mut Manager<'_>,
    ) -> Result<Self::Context, Self::Error>;
}
Expand description

Represents an individual task that a CLI command is composed of.

Required Associated Types§

Source

type Context

The type of context that is passed to this task, processed and subsequently returned by this task.

Source

type Error

The type of error that this task can return.

Required Methods§

Source

fn verb(&self) -> &str

The verb that describes this task (e.g. “Launching” or “Building”) that is shown to the user while the task is running.

Source

fn message(&self) -> &str

The message that is shown to the user alongside the verb. This usually starts with a lowercase letter (e.g. “[Generating] source tree”).

Source

fn detail(&self) -> &str

Optional additional text that is shown to the user alongside the message. This usually starts with a lowercase letter too (e.g.

Source

fn run( &self, context: Self::Context, manager: &mut Manager<'_>, ) -> Result<Self::Context, Self::Error>

This function should execute the task.

Implementors§

Source§

impl Task for AndroidTask

Source§

impl Task for IOSTask

Source§

impl Task for polyhorn_cli::android::tasks::BuildRuntimeLibrary

Source§

impl Task for FindAndroidStudio

Source§

impl Task for GenerateSourceTree

Source§

impl Task for Install

Source§

impl Task for LinkNativeLibraries

Source§

impl Task for Run

Source§

impl Task for BootIOSSimulator

Source§

impl Task for polyhorn_cli::ios::tasks::BuildRuntimeLibrary

Source§

impl Task for BuildRuntimeLibraryV2

Source§

impl Task for BuildXcodeproj

Source§

impl Task for CreateUniversalBinary

Source§

impl Task for GenerateXcassets

Source§

impl Task for GenerateXcodeproj

Source§

impl Task for InstallOnIOSSimulator

Source§

impl Task for OpenIOSSimulator

Source§

impl Task for RunOnIOSSimulator

Source§

impl Task for InstallDependencies

Source§

impl Task for InstallTarget