Skip to main content

Approver

Trait Approver 

Source
pub trait Approver:
    Send
    + Sync
    + Debug {
    // Required method
    fn ask(&self, p: &Presentation) -> Answer;

    // Provided methods
    fn answer(&self, question: &str) -> Option<String> { ... }
    fn via(&self) -> String { ... }
}
Expand description

Asks a person, synchronously, while an attempt waits (a terminal prompt in the CLI, a permission request in an editor). The answer is journaled; replay never asks again.

Required Methods§

Source

fn ask(&self, p: &Presentation) -> Answer

The person’s answer to the presented call.

Provided Methods§

Source

fn answer(&self, question: &str) -> Option<String>

The person’s free-text answer to a question a hosted skill asks ; None when nobody can answer.

Source

fn via(&self) -> String

Through what the person answers: terminal, or editor <name>.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§