repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/returning_request_parts.rs | axum-macros/tests/debug_handler/fail/returning_request_parts.rs | #[axum::debug_handler]
async fn handler() -> (
axum::http::request::Parts, // this should be response parts, not request parts
axum::http::StatusCode,
) {
panic!()
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/not_send.rs | axum-macros/tests/debug_handler/fail/not_send.rs | use axum_macros::debug_handler;
#[debug_handler]
async fn handler() {
let _rc = std::rc::Rc::new(());
async {}.await;
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/output_tuple_too_many.rs | axum-macros/tests/debug_handler/fail/output_tuple_too_many.rs | use axum::response::AppendHeaders;
#[axum::debug_handler]
async fn handler() -> (
axum::http::StatusCode,
AppendHeaders<[(axum::http::HeaderName, &'static str); 1]>,
AppendHeaders<[(axum::http::HeaderName, &'static str); 1]>,
AppendHeaders<[(axum::http::HeaderName, &'static str); 1]>,
AppendHeaders... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/duplicate_args.rs | axum-macros/tests/debug_handler/fail/duplicate_args.rs | use axum_macros::debug_handler;
#[debug_handler(state = (), state = ())]
async fn handler() {}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/not_a_function.rs | axum-macros/tests/debug_handler/fail/not_a_function.rs | use axum_macros::debug_handler;
#[debug_handler]
struct A;
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/too_many_extractors.rs | axum-macros/tests/debug_handler/fail/too_many_extractors.rs | use axum::http::Uri;
use axum_macros::debug_handler;
#[debug_handler]
async fn handler(
_e1: Uri,
_e2: Uri,
_e3: Uri,
_e4: Uri,
_e5: Uri,
_e6: Uri,
_e7: Uri,
_e8: Uri,
_e9: Uri,
_e10: Uri,
_e11: Uri,
_e12: Uri,
_e13: Uri,
_e14: Uri,
_e15: Uri,
_e16: Uri,
... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/extract_self_ref.rs | axum-macros/tests/debug_handler/fail/extract_self_ref.rs | use axum::extract::{FromRequest, Request};
use axum_macros::debug_handler;
struct A;
impl<S> FromRequest<S> for A
where
S: Send + Sync,
{
type Rejection = ();
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}
impl A {
#[debug_handler... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/invalid_attrs.rs | axum-macros/tests/debug_handler/fail/invalid_attrs.rs | use axum_macros::debug_handler;
#[debug_handler(foo)]
async fn handler() {}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/single_wrong_return_tuple.rs | axum-macros/tests/debug_handler/fail/single_wrong_return_tuple.rs | #![allow(unused_parens)]
struct NotIntoResponse;
#[axum::debug_handler]
async fn handler() -> (NotIntoResponse) {
panic!()
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/fail/wrong_order.rs | axum-macros/tests/debug_handler/fail/wrong_order.rs | use axum::{http::Uri, Json};
use axum_macros::debug_handler;
#[debug_handler]
async fn one(_: Json<()>, _: Uri) {}
#[debug_handler]
async fn two(_: String, _: Uri) {}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/mut_extractor.rs | axum-macros/tests/debug_handler/pass/mut_extractor.rs | use axum_macros::debug_handler;
#[debug_handler]
async fn handler(mut foo: String) -> String {
foo += "bar";
foo
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/returns_self.rs | axum-macros/tests/debug_handler/pass/returns_self.rs | use axum::response::{IntoResponse, Response};
use axum_macros::debug_handler;
struct A;
impl A {
#[debug_handler]
async fn handler() -> Self {
A
}
}
impl IntoResponse for A {
fn into_response(self) -> Response {
todo!()
}
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/impl_future.rs | axum-macros/tests/debug_handler/pass/impl_future.rs | use axum_macros::debug_handler;
use std::future::Future;
#[debug_handler]
fn handler() -> impl Future<Output = ()> {
async {}
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/multiple_extractors.rs | axum-macros/tests/debug_handler/pass/multiple_extractors.rs | use axum::http::{Method, Uri};
use axum_macros::debug_handler;
#[debug_handler]
async fn handler(_one: Method, _two: Uri, _three: String) {}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/impl_into_response.rs | axum-macros/tests/debug_handler/pass/impl_into_response.rs | use axum::response::IntoResponse;
use axum_macros::debug_handler;
#[debug_handler]
async fn handler() -> impl IntoResponse {
"hi!"
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/result_impl_into_response.rs | axum-macros/tests/debug_handler/pass/result_impl_into_response.rs | use axum::{extract::FromRequestParts, http::request::Parts, response::IntoResponse};
use axum_macros::debug_handler;
fn main() {}
#[debug_handler]
fn concrete_future() -> std::future::Ready<Result<impl IntoResponse, ()>> {
std::future::ready(Ok(()))
}
#[debug_handler]
fn impl_future() -> impl std::future::Future... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/deny_unreachable_code.rs | axum-macros/tests/debug_handler/pass/deny_unreachable_code.rs | #![deny(unreachable_code)]
use axum::extract::Path;
#[axum_macros::debug_handler]
async fn handler(Path(_): Path<String>) {}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/infer_state.rs | axum-macros/tests/debug_handler/pass/infer_state.rs | use axum::extract::State;
use axum_macros::debug_handler;
#[debug_handler]
async fn handler(_: State<AppState>) {}
#[debug_handler]
async fn handler_2(_: axum::extract::State<AppState>) {}
#[debug_handler]
async fn handler_3(_: axum::extract::State<AppState>, _: axum::extract::State<AppState>) {}
#[debug_handler]
a... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/ready.rs | axum-macros/tests/debug_handler/pass/ready.rs | use axum_macros::debug_handler;
use std::future::{ready, Ready};
#[debug_handler]
fn handler() -> Ready<()> {
ready(())
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/self_receiver.rs | axum-macros/tests/debug_handler/pass/self_receiver.rs | use axum::extract::{FromRequest, Request};
use axum_macros::debug_handler;
struct A;
impl<S> FromRequest<S> for A
where
S: Send + Sync,
{
type Rejection = ();
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}
impl<S> FromRequest<S> for B... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/state_and_body.rs | axum-macros/tests/debug_handler/pass/state_and_body.rs | use axum::{extract::Request, extract::State};
use axum_macros::debug_handler;
#[debug_handler(state = AppState)]
async fn handler(_: State<AppState>, _: Request) {}
#[derive(Clone)]
struct AppState;
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/request_last.rs | axum-macros/tests/debug_handler/pass/request_last.rs | use axum::extract::{Extension, Request};
use axum_macros::debug_handler;
#[debug_handler]
async fn handler(_: Extension<String>, _: Request) {}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/set_state.rs | axum-macros/tests/debug_handler/pass/set_state.rs | use axum::extract::{FromRef, FromRequest, Request};
use axum_macros::debug_handler;
#[debug_handler(state = AppState)]
async fn handler(_: A) {}
#[derive(Clone)]
struct AppState;
struct A;
impl<S> FromRequest<S> for A
where
S: Send + Sync,
AppState: FromRef<S>,
{
type Rejection = ();
async fn from_... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_handler/pass/associated_fn_without_self.rs | axum-macros/tests/debug_handler/pass/associated_fn_without_self.rs | use axum_macros::debug_handler;
struct A;
impl A {
#[debug_handler]
async fn handler() {}
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/fail/not_deserialize.rs | axum-macros/tests/typed_path/fail/not_deserialize.rs | use axum_macros::TypedPath;
#[derive(TypedPath)]
#[typed_path("/users/{id}")]
struct MyPath {
id: u32,
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/fail/missing_capture.rs | axum-macros/tests/typed_path/fail/missing_capture.rs | use axum_macros::TypedPath;
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/users")]
struct MyPath {
id: u32,
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/fail/unit_with_capture.rs | axum-macros/tests/typed_path/fail/unit_with_capture.rs | use axum_macros::TypedPath;
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/users/{id}")]
struct MyPath;
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/fail/route_not_starting_with_slash_non_empty.rs | axum-macros/tests/typed_path/fail/route_not_starting_with_slash_non_empty.rs | use axum_extra::routing::TypedPath;
#[derive(TypedPath)]
#[typed_path("{foo}")]
struct MyPath;
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/fail/missing_field.rs | axum-macros/tests/typed_path/fail/missing_field.rs | use axum_macros::TypedPath;
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/users/{id}")]
struct MyPath {}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/fail/route_not_starting_with_slash.rs | axum-macros/tests/typed_path/fail/route_not_starting_with_slash.rs | use axum_extra::routing::TypedPath;
#[derive(TypedPath)]
#[typed_path("")]
struct MyPath;
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/named_fields_struct.rs | axum-macros/tests/typed_path/pass/named_fields_struct.rs | use axum_extra::routing::TypedPath;
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/users/{user_id}/teams/{team_id}")]
struct MyPath {
user_id: u32,
team_id: u32,
}
fn main() {
_ = axum::Router::<()>::new().route("/", axum::routing::get(|_: MyPath| async {}));
assert_eq!(MyPa... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/result_handler.rs | axum-macros/tests/typed_path/pass/result_handler.rs | use axum::{extract::rejection::PathRejection, http::StatusCode};
use axum_extra::routing::{RouterExt, TypedPath};
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/users/{id}")]
struct UsersShow {
id: String,
}
async fn result_handler(_: Result<UsersShow, PathRejection>) {}
#[derive(TypedP... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/tuple_struct.rs | axum-macros/tests/typed_path/pass/tuple_struct.rs | use axum_extra::routing::TypedPath;
use serde::Deserialize;
pub type Result<T> = std::result::Result<T, ()>;
#[derive(TypedPath, Deserialize)]
#[typed_path("/users/{user_id}/teams/{team_id}")]
struct MyPath(u32, u32);
fn main() {
_ = axum::Router::<()>::new().route("/", axum::routing::get(|_: MyPath| async {}));... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/into_uri.rs | axum-macros/tests/typed_path/pass/into_uri.rs | use axum::http::Uri;
use axum_extra::routing::TypedPath;
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/{id}")]
struct Named {
id: u32,
}
#[derive(TypedPath, Deserialize)]
#[typed_path("/{id}")]
struct Unnamed(u32);
#[derive(TypedPath, Deserialize)]
#[typed_path("/")]
struct Unit;
fn m... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/customize_rejection.rs | axum-macros/tests/typed_path/pass/customize_rejection.rs | use axum::{
extract::rejection::PathRejection,
response::{IntoResponse, Response},
};
use axum_extra::routing::{RouterExt, TypedPath};
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/{foo}", rejection(MyRejection))]
struct MyPathNamed {
foo: String,
}
#[derive(TypedPath, Deseriali... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/wildcards.rs | axum-macros/tests/typed_path/pass/wildcards.rs | use axum_extra::routing::{RouterExt, TypedPath};
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/{*rest}")]
struct MyPath {
rest: String,
}
fn main() {
_ = axum::Router::<()>::new().typed_get(|_: MyPath| async {});
}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/url_encoding.rs | axum-macros/tests/typed_path/pass/url_encoding.rs | use axum_extra::routing::TypedPath;
use serde::Deserialize;
#[derive(TypedPath, Deserialize)]
#[typed_path("/{param}")]
struct Named {
param: String,
}
#[derive(TypedPath, Deserialize)]
#[typed_path("/{param}")]
struct Unnamed(String);
fn main() {
assert_eq!(
format!(
"{}",
Na... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/typed_path/pass/unit_struct.rs | axum-macros/tests/typed_path/pass/unit_struct.rs | use axum_extra::routing::TypedPath;
#[derive(TypedPath)]
#[typed_path("/users")]
struct MyPath;
fn main() {
_ = axum::Router::<()>::new().route("/", axum::routing::get(|_: MyPath| async {}));
assert_eq!(MyPath::PATH, "/users");
assert_eq!(format!("{}", MyPath), "/users");
}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_middleware/fail/takes_next_twice.rs | axum-macros/tests/debug_middleware/fail/takes_next_twice.rs | use axum::{debug_middleware, extract::Request, middleware::Next, response::Response};
#[debug_middleware]
async fn my_middleware(request: Request, next: Next, next2: Next) -> Response {
let _ = next2;
next.run(request).await
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_middleware/fail/doesnt_take_next.rs | axum-macros/tests/debug_middleware/fail/doesnt_take_next.rs | use axum::{
debug_middleware,
extract::Request,
response::{IntoResponse, Response},
};
#[debug_middleware]
async fn my_middleware(request: Request) -> Response {
let _ = request;
().into_response()
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_middleware/fail/next_not_last.rs | axum-macros/tests/debug_middleware/fail/next_not_last.rs | use axum::{debug_middleware, extract::Request, middleware::Next, response::Response};
#[debug_middleware]
async fn my_middleware(next: Next, request: Request) -> Response {
next.run(request).await
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/debug_middleware/pass/basic.rs | axum-macros/tests/debug_middleware/pass/basic.rs | use axum::{debug_middleware, extract::Request, middleware::Next, response::Response};
#[debug_middleware]
async fn my_middleware(request: Request, next: Next) -> Response {
next.run(request).await
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/from_ref/fail/generics.rs | axum-macros/tests/from_ref/fail/generics.rs | use axum::extract::FromRef;
#[derive(Clone, FromRef)]
struct AppState<T> {
foo: T,
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/from_ref/pass/reference-types.rs | axum-macros/tests/from_ref/pass/reference-types.rs | #![deny(noop_method_call)]
use axum_macros::FromRef;
#[derive(FromRef)]
struct State {
inner: &'static str,
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/from_ref/pass/skip.rs | axum-macros/tests/from_ref/pass/skip.rs | use axum_macros::FromRef;
#[derive(Clone, FromRef)]
struct AppState {
auth_token: String,
#[from_ref(skip)]
also_string: String,
}
fn main() {}
| rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
tokio-rs/axum | https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum-macros/tests/from_ref/pass/basic.rs | axum-macros/tests/from_ref/pass/basic.rs | use axum::{
extract::{FromRef, State},
routing::get,
Router,
};
// This will implement `FromRef` for each field in the struct.
#[derive(Clone, FromRef)]
struct AppState {
auth_token: String,
}
// So those types can be extracted via `State`
async fn handler(_: State<String>) {}
fn main() {
let sta... | rust | MIT | 183ace306ab126f034c55d9147ea3513c8a5a139 | 2026-01-04T15:37:41.118512Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/extractor.rs | actix-multipart/src/extractor.rs | use actix_utils::future::{ready, Ready};
use actix_web::{dev::Payload, Error, FromRequest, HttpRequest};
use crate::multipart::Multipart;
/// Extract request's payload as multipart stream.
///
/// Content-type: multipart/*;
///
/// # Examples
///
/// ```
/// use actix_web::{web, HttpResponse};
/// use actix_multipart... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/safety.rs | actix-multipart/src/safety.rs | use std::{cell::Cell, marker::PhantomData, rc::Rc, task};
use local_waker::LocalWaker;
/// Counter. It tracks of number of clones of payloads and give access to payload only to top most.
///
/// - When dropped, parent task is awakened. This is to support the case where `Field` is dropped in
/// a separate task than... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/field.rs | actix-multipart/src/field.rs | use std::{
cell::RefCell,
cmp, fmt,
future::poll_fn,
mem,
pin::Pin,
rc::Rc,
task::{ready, Context, Poll},
};
use actix_web::{
error::PayloadError,
http::header::{self, ContentDisposition, HeaderMap},
web::{Bytes, BytesMut},
};
use derive_more::{Display, Error};
use futures_core:... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/test.rs | actix-multipart/src/test.rs | //! Multipart testing utilities.
use actix_web::{
http::header::{self, HeaderMap},
web::{BufMut as _, Bytes, BytesMut},
};
use mime::Mime;
use rand::distr::{Alphanumeric, SampleString as _};
const CRLF: &[u8] = b"\r\n";
const CRLF_CRLF: &[u8] = b"\r\n\r\n";
const HYPHENS: &[u8] = b"--";
const BOUNDARY_PREFIX:... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/lib.rs | actix-multipart/src/lib.rs | //! Multipart request & form support for Actix Web.
//!
//! The [`Multipart`] extractor aims to support all kinds of `multipart/*` requests, including
//! `multipart/form-data`, `multipart/related` and `multipart/mixed`. This is a lower-level
//! extractor which supports reading [multipart fields](Field), in the order ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/multipart.rs | actix-multipart/src/multipart.rs | //! Multipart response payload support.
use std::{
cell::RefCell,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_web::{
dev,
error::{ParseError, PayloadError},
http::header::{self, ContentDisposition, HeaderMap, HeaderName, HeaderValue},
web::Bytes,
HttpRequest,
};
use futur... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/error.rs | actix-multipart/src/error.rs | //! Error and Result module
use actix_web::{
error::{ParseError, PayloadError},
http::StatusCode,
ResponseError,
};
use derive_more::{Display, Error, From};
/// A set of errors that can occur during parsing multipart streams.
#[derive(Debug, Display, From, Error)]
#[non_exhaustive]
pub enum Error {
//... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/payload.rs | actix-multipart/src/payload.rs | use std::{
cell::{RefCell, RefMut},
cmp, mem,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_web::{
error::PayloadError,
web::{Bytes, BytesMut},
};
use futures_core::stream::{LocalBoxStream, Stream};
use crate::{error::Error, safety::Safety};
pub(crate) struct PayloadRef {
payl... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/form/bytes.rs | actix-multipart/src/form/bytes.rs | //! Reads a field into memory.
use actix_web::{web::BytesMut, HttpRequest};
use futures_core::future::LocalBoxFuture;
use futures_util::TryStreamExt as _;
use mime::Mime;
use crate::{
form::{FieldReader, Limits},
Field, MultipartError,
};
/// Read the field into memory.
#[derive(Debug)]
pub struct Bytes {
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/form/json.rs | actix-multipart/src/form/json.rs | //! Deserializes a field as JSON.
use std::sync::Arc;
use actix_web::{http::StatusCode, web, Error, HttpRequest, ResponseError};
use derive_more::{Deref, DerefMut, Display, Error};
use futures_core::future::LocalBoxFuture;
use serde::de::DeserializeOwned;
use super::FieldErrorHandler;
use crate::{
form::{bytes::... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/form/text.rs | actix-multipart/src/form/text.rs | //! Deserializes a field from plain text.
use std::{str, sync::Arc};
use actix_web::{http::StatusCode, web, Error, HttpRequest, ResponseError};
use derive_more::{Deref, DerefMut, Display, Error};
use futures_core::future::LocalBoxFuture;
use serde::de::DeserializeOwned;
use super::FieldErrorHandler;
use crate::{
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/form/mod.rs | actix-multipart/src/form/mod.rs | //! Extract and process typed data from fields of a `multipart/form-data` request.
use std::{
any::Any,
collections::HashMap,
future::{ready, Future},
sync::Arc,
};
use actix_web::{dev, error::PayloadError, web, Error, FromRequest, HttpRequest};
use derive_more::{Deref, DerefMut};
use futures_core::fu... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/src/form/tempfile.rs | actix-multipart/src/form/tempfile.rs | //! Writes a field to a temporary file on disk.
use std::{
io,
path::{Path, PathBuf},
sync::Arc,
};
use actix_web::{http::StatusCode, web, Error, HttpRequest, ResponseError};
use derive_more::{Display, Error};
use futures_core::future::LocalBoxFuture;
use futures_util::TryStreamExt as _;
use mime::Mime;
u... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-multipart/examples/form.rs | actix-multipart/examples/form.rs | use actix_multipart::form::{
json::Json as MpJson, tempfile::TempFile, MultipartForm, MultipartFormConfig,
};
use actix_web::{middleware::Logger, post, App, HttpServer, Responder};
use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct Metadata {
name: String,
}
#[derive(Debug, MultipartForm)]
struct Up... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/src/lib.rs | actix-web-codegen/src/lib.rs | //! Routing and runtime macros for Actix Web.
//!
//! # Actix Web Re-exports
//! Actix Web re-exports a version of this crate in it's entirety so you usually don't have to
//! specify a dependency on this crate explicitly. Sometimes, however, updates are made to this
//! crate before the actix-web dependency is updated... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/src/scope.rs | actix-web-codegen/src/scope.rs | use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::{quote, ToTokens as _};
use crate::{
input_and_compile_error,
route::{MethodType, RouteArgs},
};
pub fn with_scope(args: TokenStream, input: TokenStream) -> TokenStream {
match with_scope_inner(args, input.clone(... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/src/route.rs | actix-web-codegen/src/route.rs | use std::collections::HashSet;
use actix_router::ResourceDef;
use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::{quote, ToTokens, TokenStreamExt};
use syn::{punctuated::Punctuated, Ident, LitStr, Path, Token};
use crate::input_and_compile_error;
#[derive(Debug)]
pub struct... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild.rs | actix-web-codegen/tests/trybuild.rs | #[rustversion_msrv::msrv]
#[test]
fn compile_macros() {
let t = trybuild::TestCases::new();
t.pass("tests/trybuild/simple.rs");
t.compile_fail("tests/trybuild/simple-fail.rs");
t.pass("tests/trybuild/route-ok.rs");
t.compile_fail("tests/trybuild/route-missing-method-fail.rs");
t.compile_fail("... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/routes.rs | actix-web-codegen/tests/routes.rs | use std::future::Future;
use actix_utils::future::{ok, Ready};
use actix_web::{
dev::{Service, ServiceRequest, ServiceResponse, Transform},
http::{
self,
header::{HeaderName, HeaderValue},
StatusCode,
},
web, App, Error, HttpRequest, HttpResponse, Responder,
};
use actix_web_cod... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/scopes.rs | actix-web-codegen/tests/scopes.rs | use actix_web::{guard::GuardContext, http, http::header, web, App, HttpResponse, Responder};
use actix_web_codegen::{delete, get, post, route, routes, scope};
pub fn image_guard(ctx: &GuardContext<'_>) -> bool {
ctx.header::<header::Accept>()
.map(|h| h.preference() == "image/*")
.unwrap_or(false)
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/route-custom-method.rs | actix-web-codegen/tests/trybuild/route-custom-method.rs | use std::str::FromStr;
use actix_web::http::Method;
use actix_web_codegen::route;
#[route("/single", method = "CUSTOM")]
async fn index() -> String {
"Hello Single!".to_owned()
}
#[route("/multi", method = "GET", method = "CUSTOM")]
async fn custom() -> String {
"Hello Multi!".to_owned()
}
#[actix_web::main... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/scope-on-handler.rs | actix-web-codegen/tests/trybuild/scope-on-handler.rs | use actix_web_codegen::scope;
#[scope("/api")]
async fn index() -> &'static str {
"Hello World!"
}
fn main() {}
| rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/simple-fail.rs | actix-web-codegen/tests/trybuild/simple-fail.rs | use actix_web_codegen::*;
#[get("/one", other)]
async fn one() -> String {
"Hello World!".to_owned()
}
#[post(/two)]
async fn two() -> String {
"Hello World!".to_owned()
}
static PATCH_PATH: &str = "/three";
#[patch(PATCH_PATH)]
async fn three() -> String {
"Hello World!".to_owned()
}
#[delete("/four",... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/routes-ok.rs | actix-web-codegen/tests/trybuild/routes-ok.rs | use actix_web_codegen::*;
#[routes]
#[get("/")]
#[post("/")]
async fn index() -> String {
"Hello World!".to_owned()
}
#[actix_web::main]
async fn main() {
use actix_web::App;
let srv = actix_test::start(|| App::new().service(index));
let request = srv.get("/");
let response = request.send().awai... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/routes-missing-method-fail.rs | actix-web-codegen/tests/trybuild/routes-missing-method-fail.rs | use actix_web_codegen::*;
#[routes]
async fn index() -> String {
"Hello World!".to_owned()
}
#[actix_web::main]
async fn main() {
use actix_web::App;
let srv = actix_test::start(|| App::new().service(index));
}
| rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/route-ok.rs | actix-web-codegen/tests/trybuild/route-ok.rs | use actix_web_codegen::*;
#[route("/", method="GET", method="HEAD")]
async fn index() -> String {
"Hello World!".to_owned()
}
#[actix_web::main]
async fn main() {
use actix_web::App;
let srv = actix_test::start(|| App::new().service(index));
let request = srv.get("/");
let response = request.sen... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/route-malformed-path-fail.rs | actix-web-codegen/tests/trybuild/route-malformed-path-fail.rs | use actix_web_codegen::get;
#[get("/{")]
async fn zero() -> &'static str {
"malformed resource def"
}
#[get("/{foo")]
async fn one() -> &'static str {
"malformed resource def"
}
#[get("/{}")]
async fn two() -> &'static str {
"malformed resource def"
}
#[get("/*")]
async fn three() -> &'static str {
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/scope-missing-args.rs | actix-web-codegen/tests/trybuild/scope-missing-args.rs | use actix_web_codegen::scope;
#[scope]
mod api {}
fn main() {}
| rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/test-runtime.rs | actix-web-codegen/tests/trybuild/test-runtime.rs | #[actix_web::test]
async fn my_test() {
assert!(async { 1 }.await, 1);
}
fn main() {}
| rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/docstring-ok.rs | actix-web-codegen/tests/trybuild/docstring-ok.rs | use actix_web::{Responder, HttpResponse, App};
use actix_web_codegen::*;
/// doc comments shouldn't break anything
#[get("/")]
async fn index() -> impl Responder {
HttpResponse::Ok()
}
#[actix_web::main]
async fn main() {
let srv = actix_test::start(|| App::new().service(index));
let request = srv.get("/... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/routes-missing-args-fail.rs | actix-web-codegen/tests/trybuild/routes-missing-args-fail.rs | use actix_web_codegen::*;
#[routes]
#[get]
async fn index() -> String {
"Hello World!".to_owned()
}
#[actix_web::main]
async fn main() {
use actix_web::App;
let srv = actix_test::start(|| App::new().service(index));
}
| rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/scope-trailing-slash.rs | actix-web-codegen/tests/trybuild/scope-trailing-slash.rs | use actix_web_codegen::scope;
#[scope("/api/")]
mod api {}
fn main() {}
| rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/simple.rs | actix-web-codegen/tests/trybuild/simple.rs | use actix_web::{Responder, HttpResponse, App};
use actix_web_codegen::*;
#[get("/config")]
async fn config() -> impl Responder {
HttpResponse::Ok()
}
#[actix_web::main]
async fn main() {
let srv = actix_test::start(|| App::new().service(config));
let request = srv.get("/config");
let response = reque... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/scope-invalid-args.rs | actix-web-codegen/tests/trybuild/scope-invalid-args.rs | use actix_web_codegen::scope;
const PATH: &str = "/api";
#[scope(PATH)]
mod api_const {}
#[scope(true)]
mod api_bool {}
#[scope(123)]
mod api_num {}
fn main() {}
| rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/route-custom-lowercase.rs | actix-web-codegen/tests/trybuild/route-custom-lowercase.rs | use actix_web_codegen::*;
use actix_web::http::Method;
use std::str::FromStr;
#[route("/", method = "hello")]
async fn index() -> String {
"Hello World!".to_owned()
}
#[actix_web::main]
async fn main() {
use actix_web::App;
let srv = actix_test::start(|| App::new().service(index));
let request = srv... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/route-missing-method-fail.rs | actix-web-codegen/tests/trybuild/route-missing-method-fail.rs | use actix_web_codegen::*;
#[route("/")]
async fn index() -> String {
"Hello World!".to_owned()
}
#[actix_web::main]
async fn main() {
use actix_web::App;
let srv = actix_test::start(|| App::new().service(index));
let request = srv.get("/");
let response = request.send().await.unwrap();
a... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-codegen/tests/trybuild/route-duplicate-method-fail.rs | actix-web-codegen/tests/trybuild/route-duplicate-method-fail.rs | use actix_web_codegen::*;
#[route("/", method="GET", method="GET")]
async fn index() -> String {
"Hello World!".to_owned()
}
#[actix_web::main]
async fn main() {
use actix_web::App;
let srv = actix_test::start(|| App::new().service(index));
let request = srv.get("/");
let response = request.send... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/chunked.rs | actix-files/src/chunked.rs | use std::{
cmp, fmt,
future::Future,
io,
pin::Pin,
task::{Context, Poll},
};
use actix_web::{error::Error, web::Bytes};
#[cfg(feature = "experimental-io-uring")]
use bytes::BytesMut;
use futures_core::{ready, Stream};
use pin_project_lite::pin_project;
use super::named::File;
#[derive(Debug, Clon... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/lib.rs | actix-files/src/lib.rs | //! Static file serving for Actix Web.
//!
//! Provides a non-blocking service for serving static files from disk.
//!
//! # Examples
//! ```
//! use actix_web::App;
//! use actix_files::Files;
//!
//! let app = App::new()
//! .service(Files::new("/static", ".").prefer_utf8(true));
//! ```
#![warn(missing_docs, mi... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/range.rs | actix-files/src/range.rs | use std::fmt;
use derive_more::Error;
/// Copy of `http_range::HttpRangeParseError`.
#[derive(Debug, Clone)]
enum HttpRangeParseError {
InvalidRange,
NoOverlap,
}
impl From<http_range::HttpRangeParseError> for HttpRangeParseError {
fn from(err: http_range::HttpRangeParseError) -> Self {
match err... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/error.rs | actix-files/src/error.rs | use actix_web::{http::StatusCode, ResponseError};
use derive_more::Display;
/// Errors which can occur when serving static files.
#[derive(Debug, PartialEq, Eq, Display)]
pub enum FilesError {
/// Path is not a directory.
#[allow(dead_code)]
#[display("path is not a directory. Unable to serve static files"... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/service.rs | actix-files/src/service.rs | use std::{fmt, io, ops::Deref, path::PathBuf, rc::Rc};
use actix_web::{
body::BoxBody,
dev::{self, Service, ServiceRequest, ServiceResponse},
error::Error,
guard::Guard,
http::{header, Method},
HttpResponse,
};
use futures_core::future::LocalBoxFuture;
use crate::{
named, Directory, Direct... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/path_buf.rs | actix-files/src/path_buf.rs | use std::{
path::{Component, Path, PathBuf},
str::FromStr,
};
use actix_utils::future::{ready, Ready};
use actix_web::{dev::Payload, FromRequest, HttpRequest};
use crate::error::UriSegmentError;
#[derive(Debug, PartialEq, Eq)]
pub(crate) struct PathBufWrap(PathBuf);
impl FromStr for PathBufWrap {
type E... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/named.rs | actix-files/src/named.rs | use std::{
fs::Metadata,
io,
path::{Path, PathBuf},
time::{SystemTime, UNIX_EPOCH},
};
use actix_web::{
body::{self, BoxBody, SizedStream},
dev::{
self, AppService, HttpServiceFactory, ResourceDef, Service, ServiceFactory, ServiceRequest,
ServiceResponse,
},
http::{
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/files.rs | actix-files/src/files.rs | use std::{
cell::RefCell,
fmt, io,
path::{Path, PathBuf},
rc::Rc,
};
use actix_service::{boxed, IntoServiceFactory, ServiceFactory, ServiceFactoryExt};
use actix_web::{
dev::{
AppService, HttpServiceFactory, RequestHead, ResourceDef, ServiceRequest, ServiceResponse,
},
error::Error,... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/encoding.rs | actix-files/src/encoding.rs | use mime::Mime;
/// Transforms MIME `text/*` types into their UTF-8 equivalent, if supported.
///
/// MIME types that are converted
/// - application/javascript
/// - text/html
/// - text/css
/// - text/plain
/// - text/csv
/// - text/tab-separated-values
pub(crate) fn equiv_utf8_text(ct: Mime) -> Mime {
// use (r... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/src/directory.rs | actix-files/src/directory.rs | use std::{
fmt::Write,
fs::DirEntry,
io,
path::{Path, PathBuf},
};
use actix_web::{dev::ServiceResponse, HttpRequest, HttpResponse};
use percent_encoding::{utf8_percent_encode, CONTROLS};
use v_htmlescape::escape as escape_html_entity;
/// A directory; responds with the generated directory listing.
#[... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/tests/guard.rs | actix-files/tests/guard.rs | use actix_files::Files;
use actix_web::{
guard::Host,
http::StatusCode,
test::{self, TestRequest},
App,
};
use bytes::Bytes;
#[actix_web::test]
async fn test_guard_filter() {
let srv = test::init_service(
App::new()
.service(Files::new("/", "./tests/fixtures/guards/first").guard... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/tests/traversal.rs | actix-files/tests/traversal.rs | use actix_files::Files;
use actix_web::{
http::StatusCode,
test::{self, TestRequest},
App,
};
#[actix_rt::test]
async fn test_directory_traversal_prevention() {
let srv = test::init_service(App::new().service(Files::new("/", "./tests"))).await;
let req = TestRequest::with_uri("/../../../../../../.... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/tests/encoding.rs | actix-files/tests/encoding.rs | use actix_files::{Files, NamedFile};
use actix_web::{
http::{
header::{self, HeaderValue},
StatusCode,
},
test::{self, TestRequest},
web, App,
};
#[actix_web::test]
async fn test_utf8_file_contents() {
// use default ISO-8859-1 encoding
let srv = test::init_service(App::new().se... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-files/examples/guarded-listing.rs | actix-files/examples/guarded-listing.rs | use actix_files::Files;
use actix_web::{get, guard, middleware, App, HttpServer, Responder};
const EXAMPLES_DIR: &str = concat![env!("CARGO_MANIFEST_DIR"), "/examples"];
#[get("/")]
async fn index() -> impl Responder {
"Hello world!"
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
env_logger::i... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-actors/src/lib.rs | actix-web-actors/src/lib.rs | //! Actix actors support for Actix Web.
//!
//! This crate is deprecated. Migrate to [`actix-ws`](https://crates.io/crates/actix-ws).
//!
//! # Examples
//!
//! ```no_run
//! use actix::{Actor, StreamHandler};
//! use actix_web::{get, web, App, Error, HttpRequest, HttpResponse, HttpServer};
//! use actix_web_actors::ws... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-actors/src/ws.rs | actix-web-actors/src/ws.rs | //! Websocket integration.
//!
//! # Examples
//!
//! ```no_run
//! use actix::{Actor, StreamHandler};
//! use actix_web::{get, web, App, Error, HttpRequest, HttpResponse, HttpServer};
//! use actix_web_actors::ws;
//!
//! /// Define Websocket actor
//! struct MyWs;
//!
//! impl Actor for MyWs {
//! type Context = ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-actors/src/context.rs | actix-web-actors/src/context.rs | use std::{
collections::VecDeque,
future::Future,
pin::Pin,
task::{Context, Poll},
};
use actix::{
dev::{AsyncContextParts, ContextFut, ContextParts, Envelope, Mailbox, ToEnvelope},
fut::ActorFuture,
Actor, ActorContext, ActorState, Addr, AsyncContext, Handler, Message, SpawnHandle,
};
use ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.