Skip to main content

Result

Type Alias Result 

Source
pub type Result<T> = Result<T, Error>;
Expand description

A specialized Result type for bubbletea operations.

This type alias is used throughout the bubbletea crate for convenience. It defaults to Error as the error type.

§Example

use bubbletea::Result;

fn run_program() -> Result<()> {
    // ... implementation
    Ok(())
}

§Converting to Other Error Types

When integrating with other crates like anyhow:

use anyhow::Context;

fn main() -> anyhow::Result<()> {
    let model = bubbletea::Program::new(my_model)
        .run()
        .context("failed to run TUI program")?;
    Ok(())
}

Aliased Type§

pub enum Result<T> {
    Ok(T),
    Err(Error),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(Error)

Contains the error value