shuttle_axum

Type Alias ShuttleAxum

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

§Shuttle service integration for the Axum web framework

Axum 0.7 is used by default.

Axum 0.6 is supported by using these feature flags:

axum = "0.6.0"
shuttle-axum = { version = "0.49.0", default-features = false, features = ["axum-0-6"] }

§Example

use axum::{routing::get, Router};

async fn hello_world() -> &'static str {
    "Hello, world!"
}

#[shuttle_runtime::main]
async fn axum() -> shuttle_axum::ShuttleAxum {
    let router = Router::new().route("/", get(hello_world));

    Ok(router.into())
}

Aliased Type§

enum ShuttleAxum {
    Ok(AxumService),
    Err(Error),
}

Variants§

§1.0.0

Ok(AxumService)

Contains the success value

§1.0.0

Err(Error)

Contains the error value