Result

Type Alias Result 

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

A specialized Result type for chatpack operations.

This type is broadly used across the library for any operation that may produce an error.

§Example

use chatpack::error::Result;
use chatpack::Message;

fn my_function() -> Result<Vec<Message>> {
    // ... operations that may fail
    Ok(vec![])
}

Aliased Type§

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

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(ChatpackError)

Contains the error value