Skip to main content

run_init

Function run_init 

Source
pub async fn run_init<R, W, Fut>(
    reader: &mut R,
    writer: &mut W,
    config_path: &Path,
    profile_arg: Option<&str>,
    validate: impl Fn(String, String) -> Fut,
) -> Result<(), HaError>
where R: BufRead, W: Write, Fut: Future<Output = Option<String>>,
Expand description

Interactive init flow with injectable IO and async validator for testing.

validate receives (url, token) and returns Some(display_name) on success or None on auth failure.