[][src]Trait polyhorn_cli::core::Task

pub trait Task {
    type Context;
    type Error;
    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>; }

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

Associated Types

type Context

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

type Error

The type of error that this task can return.

Loading content...

Required methods

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.

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").

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.

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

This function should execute the task.

Loading content...

Implementors

impl Task for AndroidTask[src]

type Context = AndroidContext

type Error = AndroidError

impl Task for BuildRuntimeLibrary[src]

type Context = AndroidContext

type Error = AndroidError

impl Task for FindAndroidStudio[src]

type Context = AndroidContext

type Error = AndroidError

impl Task for GenerateSourceTree[src]

type Context = AndroidContext

type Error = AndroidError

impl Task for Install[src]

type Context = AndroidContext

type Error = AndroidError

impl Task for LinkNativeLibraries[src]

type Context = AndroidContext

type Error = AndroidError

impl Task for Run[src]

type Context = AndroidContext

type Error = AndroidError

Loading content...