Type Alias Result

Source
pub type Result<R = Response, E = Error> = Result<R, E>;
Expand description

A type alias for std::result::Result.

The most common use-case for this type is for endpoints, which return this type as a response for a request.

§Examples

async fn handle(req: under::Request) -> under::Result {
    return Ok(under::Response::text("hello, world!"));
}

let mut http = under::http();
http.at("/").get(handle);

Aliased Type§

pub enum Result<R = Response, E = Error> {
    Ok(R),
    Err(E),
}

Variants§

§1.0.0

Ok(R)

Contains the success value

§1.0.0

Err(E)

Contains the error value