Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
temp-env = "0.3"
time = "0.3"
tokio = { version = "1.24.2", features = ["sync", "io-util"] }
tokio = { version = "1.51", features = ["io-util", "macros", "rt", "sync"] }
tokio-stream = "0.1.1"
tokio-util = "0.7.4"
tracing = "0.1.30"
Expand Down
1 change: 1 addition & 0 deletions auth/casbin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rust-version.workspace = true
actix-web = { workspace = true }
casbin = "2"
env_logger = { workspace = true }
tokio.workspace = true
2 changes: 1 addition & 1 deletion auth/casbin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async fn fail(enforcer: web::Data<Enforcer>) -> HttpResponse {
HttpResponse::Ok().body("Fail: alice is not data1_admin.") // In fact, it can't be displayed.
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions auth/cookie-auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ actix-web.workspace = true

env_logger.workspace = true
log.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion auth/cookie-auth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn logout(id: Identity) -> impl Responder {
web::Redirect::to("/").using_status_code(StatusCode::FOUND)
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions auth/cookie-session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ actix-web.workspace = true
actix-session = { workspace = true, features = ["cookie-session"] }
log.workspace = true
env_logger.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion auth/cookie-session/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn index(session: Session, req: HttpRequest) -> Result<&'static str> {
Ok("welcome!")
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions auth/redis-session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env_logger.workspace = true
log.workspace = true
serde.workspace = true
serde_json.workspace = true
tokio.workspace = true

[dev-dependencies]
actix-test.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion auth/redis-session/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async fn logout(session: Session) -> Result<String> {
}
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions auth/simple-auth-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ serde.workspace = true
sparklepost = "0.6"
temp-env.workspace = true
time.workspace = true
tokio.workspace = true
uuid.workspace = true
2 changes: 1 addition & 1 deletion auth/simple-auth-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod register_handler;
mod schema;
mod utils;

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
unsafe { dotenvor::dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
Expand Down
1 change: 1 addition & 0 deletions basics/basics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ actix-web = { workspace = true }
actix-web-lab = { workspace = true }
async-stream = { workspace = true }
examples-common = { workspace = true }
tokio.workspace = true
tracing = { workspace = true }
2 changes: 1 addition & 1 deletion basics/basics/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn with_param(req: HttpRequest, Path((name,)): Path<(String,)>) -> HttpRes
.body(format!("Hello {name}!"))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
examples_common::init_standard_logger();

Expand Down
1 change: 1 addition & 0 deletions basics/error-handling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ log.workspace = true
rand.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion basics/error-handling/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async fn do_something() -> Result<HttpResponse, Error> {
})))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions basics/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rust-version.workspace = true
actix-web.workspace = true
env_logger.workspace = true
log.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion basics/hello-world/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ async fn index(req: HttpRequest) -> &'static str {
"Hello world!"
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions basics/nested-routing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ actix-web.workspace = true
env_logger.workspace = true
log.workspace = true
serde.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion basics/nested-routing/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use actix_web::{App, HttpServer, middleware};
use nested_routing::app_config::config_app;

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions basics/state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rust-version.workspace = true
actix-web.workspace = true
env_logger.workspace = true
log.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion basics/state/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async fn index(
HttpResponse::Ok().body(body)
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions basics/static-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ actix-web.workspace = true
actix-files.workspace = true
env_logger.workspace = true
log.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion basics/static-files/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use actix_files::Files;
use actix_web::{App, HttpServer, middleware::Logger};

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions basics/todo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ log.workspace = true
serde.workspace = true
sqlx = { version = "0.9", features = ["runtime-tokio", "tls-rustls", "sqlite"] }
tera = { version = "2", features = ["glob_fs"] }
tokio.workspace = true
2 changes: 1 addition & 1 deletion basics/todo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod session;
// NOTE: Not a suitable session key for production.
static SESSION_SIGNING_KEY: &[u8] = &[0; 64];

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
unsafe { dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
Expand Down
1 change: 1 addition & 0 deletions cache/redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ rust-version.workspace = true
actix-web.workspace = true
env_logger.workspace = true
redis = { workspace = true, features = ["tokio-native-tls-comp"] }
tokio.workspace = true
2 changes: 1 addition & 1 deletion cache/redis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn an_expensive_function(n: web::Path<u64>) -> impl Responder {
HttpResponse::Ok().body(result.to_string())
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::result::Result<(), std::io::Error> {
env_logger::init();

Expand Down
1 change: 1 addition & 0 deletions cors/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ actix-cors.workspace = true
env_logger.workspace = true
log.workspace = true
serde.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion cors/backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use actix_web::{App, HttpServer, http::header, middleware::Logger};

mod user;

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions data-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ actix-web.workspace = true

env_logger.workspace = true
log.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion data-factory/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use actix_web::{App, HttpResponse, HttpServer, web};

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions databases/diesel-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ dotenvor = { workspace = true }
env_logger = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
tokio.workspace = true
uuid = { workspace = true }
2 changes: 1 addition & 1 deletion databases/diesel-async/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async fn add_item(
Ok(HttpResponse::Created().json(item))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
unsafe { dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
Expand Down
1 change: 1 addition & 0 deletions databases/diesel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dotenvor.workspace = true
env_logger.workspace = true
log.workspace = true
serde.workspace = true
tokio.workspace = true
uuid.workspace = true
2 changes: 1 addition & 1 deletion databases/diesel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async fn add_user(
Ok(HttpResponse::Created().json(user))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
unsafe { dotenvor::dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
Expand Down
1 change: 1 addition & 0 deletions databases/mongodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rust-version.workspace = true
actix-web.workspace = true
mongodb = "3"
serde.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion databases/mongodb/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn create_username_index(client: &Client) {
.expect("Creating an index should succeed");
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
let uri = std::env::var("MONGODB_URI").unwrap_or_else(|_| "mongodb://localhost:27017".into());

Expand Down
1 change: 1 addition & 0 deletions databases/mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ env_logger.workspace = true
log.workspace = true
mysql = "28"
serde.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion databases/mysql/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn get_conn_builder(
.pass(Some(db_password))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
// initialize environment
unsafe { dotenvor::dotenv() }.ok();
Expand Down
1 change: 1 addition & 0 deletions databases/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ deadpool-postgres = { version = "0.14", features = ["serde"] }
derive_more = { workspace = true, features = ["display", "error", "from"] }
dotenvor.workspace = true
serde.workspace = true
tokio.workspace = true
tokio-pg-mapper = "0.2.0"
tokio-pg-mapper-derive = "0.2.0"
tokio-postgres = "0.7"
2 changes: 1 addition & 1 deletion databases/postgres/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub async fn add_user(
Ok(HttpResponse::Ok().json(new_user))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
unsafe { dotenv() }.ok();

Expand Down
1 change: 1 addition & 0 deletions databases/redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ actix-web.workspace = true
env_logger.workspace = true
redis = { workspace = true, features = ["tokio-comp", "connection-manager"] }
serde.workspace = true
tokio.workspace = true
tracing.workspace = true
2 changes: 1 addition & 1 deletion databases/redis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async fn del_stuff(redis: web::Data<redis::Client>) -> actix_web::Result<impl Re
}
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions databases/sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ r2d2 = "0.8"
r2d2_sqlite = "0.24"
rusqlite = "0.31"
serde = { version = "1", features = ["derive"] }
tokio = { version = "1.51", features = ["macros", "rt"] }
2 changes: 1 addition & 1 deletion databases/sqlite/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async fn parallel_weather(db: web::Data<Pool>) -> Result<HttpResponse, AWError>
Ok(HttpResponse::Ok().json(result.map_err(AWError::from)?))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions docker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ edition = "2024"
actix-web = "4"
env_logger = "0.11"
log = "0.4"
tokio = { version = "1.51", features = ["macros", "rt"] }
2 changes: 1 addition & 1 deletion docker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async fn again() -> impl Responder {
HttpResponse::Ok().body("Hello world again!")
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions forms/form/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ rust-version.workspace = true
[dependencies]
actix-web.workspace = true
serde.workspace = true
tokio.workspace = true
2 changes: 1 addition & 1 deletion forms/form/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ struct AppState {
foo: String,
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
Expand Down
2 changes: 1 addition & 1 deletion forms/multipart-s3/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async fn index() -> impl Responder {
web::Html::new(include_str!("./index.html").to_owned())
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
unsafe { dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
Expand Down
1 change: 1 addition & 0 deletions forms/multipart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ env_logger.workspace = true
futures-util.workspace = true
log.workspace = true
sanitize-filename = "0.6"
tokio.workspace = true
uuid.workspace = true
2 changes: 1 addition & 1 deletion forms/multipart/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async fn index() -> HttpResponse {
HttpResponse::Ok().body(html)
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions graphql/async-graphql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ async-graphql-actix-web = "7"
env_logger.workspace = true
log.workspace = true
slab = "0.4"
tokio.workspace = true
2 changes: 1 addition & 1 deletion graphql/async-graphql/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async fn graphql_playground() -> impl Responder {
))
}

#[actix_web::main]
#[tokio::main(flavor = "local")]
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

Expand Down
1 change: 1 addition & 0 deletions graphql/juniper-advanced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ r2d2_mysql = "28"
dotenvor.workspace = true
env_logger.workspace = true
log.workspace = true
tokio.workspace = true
uuid.workspace = true
Loading
Loading