Skip to main content

JsonResult

Type Alias JsonResult 

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

Convenience alias for JSON API handlers. Defaults to Result<axum::Json<T>, Error>, but the error type can be overridden.

Aliased Type§

pub enum JsonResult<T, E = Error> {
    Ok(Json<T>),
    Err(E),
}

Variants§

§1.0.0

Ok(Json<T>)

Contains the success value

§1.0.0

Err(E)

Contains the error value