Skip to main content

Prompter

Trait Prompter 

Source
pub trait Prompter {
    // Required methods
    fn pat(&self, accounts_url: &str) -> Result<String>;
    fn wallet_mode(&self) -> Result<WalletMode>;
    fn wallet_address(&self) -> Result<String>;
    fn wallet_password(&self) -> Result<String>;
}
Expand description

Test-seam trait covering every TTY interaction the init flow needs. The real implementation (DialoguerPrompter) reads from the terminal; tests inject a scripted double.

Required Methods§

Source

fn pat(&self, accounts_url: &str) -> Result<String>

Prompt for a user PAT (tf_user_*). accounts_url is the page where the human can mint/copy one.

Source

fn wallet_mode(&self) -> Result<WalletMode>

Prompt for a wallet-mode choice (BYOW / generate / skip).

Source

fn wallet_address(&self) -> Result<String>

Prompt for a 0x…-prefixed wallet address (BYOW path).

Source

fn wallet_password(&self) -> Result<String>

Prompt for a keystore password, asking for confirmation (generate path).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§