Shuttle -- 开源应用程序平台
Shuttle 是一个开源应用程序平台,它使用 traits 和注释来配置您的后端部署。
- 快速开始 依赖shuttle-service于Cargo.toml:
shuttle-service = { version = "0.2", features = ["web-rocket"] }
并确保您的 Crate 有一个 cdylib 输出目标:
代码语言:javascript复制[lib]
crate-type = ["cdylib"]
- 简单使用示例
#[macro_use]
extern crate rocket;
use rocket::{Build, Rocket};
#[get("/hello")]
fn hello() -> &'static str {
"Hello, world!"
}
#[shuttle_service::main]
async fn init() -> Result<Rocket<Build>, shuttle_service::Error> {
let rocket = rocket::build().mount("/", routes![hello]);
Ok(rocket)
}
完整的示例可以在github中找到
- 部署
cargo install cargo-shuttle
cargo shuttle login
cargo shuttle deploy
您的服务将立即在{crate_name}.shuttleapp.rs. 例如:
代码语言:javascript复制curl https://hello-world-rocket-app.shuttleapp.rs
Hello, world!
- https://docs.rs/shuttle-service/latest/shuttle_service/
Pulsar Rust client
Pulsar Rust 客户端
- https://github.com/wyyerd/pulsar-rs
consdb 用 Rust 构建 TSDB
- https://github.com/cnosdb/presentations/tree/main/Use Rust To Make A TSDB
From 日报小组 侯盛鑫,坏姐姐