Preview version, will not guarantee the stability of the API! Do NOT use in production environment!


Elegant, Clean Rust development framework🛸


Crate Docs Build Status Test Coverage License

TARDIS([tɑːrdɪs] "Time And Relative Dimension In Space") From "Doctor Who".

💖 Core functions

⚙️Key Features

🚀 Quick start

The core operations of the framework all use TardisFuns as an entry point. E.g.

TardisFuns::init(relative_path) // Initialize the configuration TardisFuns::field.x // Some field operations TardisFuns::reldb().x // Some relational database operations TardisFuns::web_server().x // Some web service operations

Web service example

Dependency Configuration toml [dependencies] tardis = { version = "^0", features = ["web-server"] }

Processor Configuration ```ignore use tardis::basic::error::TardisError; use tardis::web::poemopenapi; use tardis::web::poemopenapi::param::Query; use tardis::web::web_resp::{TardisApiResult, TardisResp};

pub struct Api;

[poem_openapi::OpenApi]

impl Api { #[oai(path = "/hello", method = "get")] async fn index(&self, name: Query>) -> TardisResult { match name.0 { Some(name) => TardisResp::ok(format!("hello, {name}!")), None => TardisResp::err(TardisError::NotFound("name does not exist".to_string())), } } } ```

Startup class configuration ```ignore use tardis::basic::result::TardisResult; use tardis::tokio; use tardis::TardisFuns; use crate::processor::Api; mod processor;

[tokio::main]

async fn main() -> TardisResult<()> { // Initial configuration TardisFuns::init("config").await?; // Register the processor and start the web service TardisFuns::webserver().addmodule("", Api).start().await } ```

More examples

|-- examples |-- reldb Relational database usage example |-- web-basic Web service Usage Example |-- web-client Web client Usage Example |-- websocket WebSocket Usage Example |-- cache Cache Usage Example |-- mq Message Queue Usage Example |-- todos A complete project usage example |-- multi-apps Multi-application aggregation example |-- pg-graph-search Graph search by Postgresql example |-- perf-test Performance test case

FAQ


Thanks to Jetbrains for the Open Source License