@@ -8,7 +8,7 @@ use multer::Multipart;
8
8
use crate :: service:: ServiceState ;
9
9
use crate :: utils:: { self , ApiErrorResponse } ;
10
10
11
- /// A transparent wrapper around a type that implements [`FromRequest`] or [`IntoResponse`].
11
+ /// A transparent wrapper around a remote type that implements [`FromRequest`] or [`IntoResponse`].
12
12
///
13
13
/// # Example
14
14
///
@@ -18,45 +18,45 @@ use crate::utils::{self, ApiErrorResponse};
18
18
/// use axum::extract::{FromRequest, Request};
19
19
/// use axum::response::IntoResponse;
20
20
///
21
- /// use crate::extractors::Xt ;
21
+ /// use crate::extractors::Remote ;
22
22
///
23
23
/// // Derive `FromRequest` for `bool` for illustration purposes:
24
24
/// #[axum::async_trait]
25
- /// impl<S> axum::extract::FromRequest<S> for Xt <bool> {
26
- /// type Rejection = Xt <Infallible>;
25
+ /// impl<S> axum::extract::FromRequest<S> for Remote <bool> {
26
+ /// type Rejection = Remote <Infallible>;
27
27
///
28
28
/// async fn from_request(request: Request) -> Result<Self, Self::Rejection> {
29
- /// Ok(Xt (true))
29
+ /// Ok(Remote (true))
30
30
/// }
31
31
/// }
32
32
///
33
- /// impl IntoResponse for Xt <Infallible> {
33
+ /// impl IntoResponse for Remote <Infallible> {
34
34
/// fn into_response(self) -> axum::response::Response {
35
35
/// match self.0 {}
36
36
/// }
37
37
/// }
38
38
/// ```
39
39
#[ derive( Debug ) ]
40
- pub struct Xt < T > ( pub T ) ;
40
+ pub struct Remote < T > ( pub T ) ;
41
41
42
- impl < T > From < T > for Xt < T > {
42
+ impl < T > From < T > for Remote < T > {
43
43
fn from ( inner : T ) -> Self {
44
44
Self ( inner)
45
45
}
46
46
}
47
47
48
48
#[ axum:: async_trait]
49
- impl FromRequest < ServiceState > for Xt < Multipart < ' static > > {
50
- type Rejection = Xt < multer:: Error > ;
49
+ impl FromRequest < ServiceState > for Remote < Multipart < ' static > > {
50
+ type Rejection = Remote < multer:: Error > ;
51
51
52
52
async fn from_request ( request : Request , state : & ServiceState ) -> Result < Self , Self :: Rejection > {
53
53
utils:: multipart_from_request ( request, state. config ( ) )
54
- . map ( Xt )
55
- . map_err ( Xt )
54
+ . map ( Remote )
55
+ . map_err ( Remote )
56
56
}
57
57
}
58
58
59
- impl IntoResponse for Xt < multer:: Error > {
59
+ impl IntoResponse for Remote < multer:: Error > {
60
60
fn into_response ( self ) -> Response {
61
61
let Self ( ref error) = self ;
62
62
0 commit comments