Always store state in an Arc (#1270)

* Add extension and state benchmarks

* wip

* Arc the state everywhere

* don't require `S: Clone`

* fix example
This commit is contained in:
David Pedersen
2022-08-17 20:08:24 +00:00
committed by GitHub
parent 423308de3c
commit e7f1c88cd4
56 changed files with 199 additions and 141 deletions
+3 -3
View File
@@ -223,7 +223,7 @@ fn impl_struct_by_extracting_each_field(
B: ::axum::body::HttpBody + ::std::marker::Send + 'static,
B::Data: ::std::marker::Send,
B::Error: ::std::convert::Into<::axum::BoxError>,
S: Send,
S: ::std::marker::Send + ::std::marker::Sync,
{
type Rejection = #rejection_ident;
@@ -659,7 +659,7 @@ fn impl_struct_by_extracting_all_at_once(
#path<#via_type_generics>: ::axum::extract::FromRequest<S, B>,
#rejection_bound
B: ::std::marker::Send,
S: ::std::marker::Send,
S: ::std::marker::Send + ::std::marker::Sync,
{
type Rejection = #associated_rejection_type;
@@ -725,7 +725,7 @@ fn impl_enum_by_extracting_all_at_once(
B: ::axum::body::HttpBody + ::std::marker::Send + 'static,
B::Data: ::std::marker::Send,
B::Error: ::std::convert::Into<::axum::BoxError>,
S: ::std::marker::Send,
S: ::std::marker::Send + ::std::marker::Sync,
{
type Rejection = #associated_rejection_type;