File tree 6 files changed +8
-13
lines changed
6 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 2
2
name = " async-tftp"
3
3
version = " 0.3.6"
4
4
authors = [" oblique <psyberbits@gmail.com>" ]
5
- edition = " 2018"
5
+ edition = " 2021"
6
+ rust-version = " 1.75"
6
7
license = " MIT"
7
8
readme = " README.md"
8
9
@@ -20,7 +21,6 @@ thiserror = "1.0.48"
20
21
async-executor = " 1.5.1"
21
22
async-io = " 1.13.0"
22
23
async-lock = " 2.8.0"
23
- async-trait = " 0.1.73"
24
24
blocking = " 1.3.1"
25
25
futures-lite = " 1.13.0"
26
26
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ fn strip_path_prefixes(path: &Path) -> &Path {
29
29
path. strip_prefix ( "/" ) . or_else ( |_| path. strip_prefix ( "./" ) ) . unwrap_or ( path)
30
30
}
31
31
32
- #[ async_tftp:: async_trait]
33
32
impl Handler for TftpdTarGzHandler {
34
33
type Reader = Entry < Archive < GzipDecoder < BufReader < File > > > > ;
35
34
type Writer = Sink ;
Original file line number Diff line number Diff line change @@ -67,6 +67,3 @@ mod tests;
67
67
mod utils;
68
68
69
69
pub use crate :: error:: * ;
70
-
71
- /// Re-export of `async_trait:async_trait`.
72
- pub use async_trait:: async_trait;
Original file line number Diff line number Diff line change 1
1
use futures_lite:: { AsyncRead , AsyncWrite } ;
2
+ use std:: future:: Future ;
2
3
use std:: net:: SocketAddr ;
3
4
use std:: path:: Path ;
4
5
5
6
use crate :: packet;
6
7
7
8
/// Trait for implementing advance handlers.
8
- #[ crate :: async_trait]
9
9
pub trait Handler : Send {
10
10
type Reader : AsyncRead + Unpin + Send + ' static ;
11
11
type Writer : AsyncWrite + Unpin + Send + ' static ;
12
12
13
13
/// Open `Reader` to serve a read request.
14
- async fn read_req_open (
14
+ fn read_req_open (
15
15
& mut self ,
16
16
client : & SocketAddr ,
17
17
path : & Path ,
18
- ) -> Result < ( Self :: Reader , Option < u64 > ) , packet:: Error > ;
18
+ ) -> impl Future < Output = Result < ( Self :: Reader , Option < u64 > ) , packet:: Error > >
19
+ + Send ;
19
20
20
21
/// Open `Writer` to serve a write request.
21
- async fn write_req_open (
22
+ fn write_req_open (
22
23
& mut self ,
23
24
client : & SocketAddr ,
24
25
path : & Path ,
25
26
size : Option < u64 > ,
26
- ) -> Result < Self :: Writer , packet:: Error > ;
27
+ ) -> impl Future < Output = Result < Self :: Writer , packet:: Error > > + Send ;
27
28
}
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ impl DirHandler {
59
59
}
60
60
}
61
61
62
- #[ crate :: async_trait]
63
62
impl crate :: server:: Handler for DirHandler {
64
63
type Reader = Unblock < File > ;
65
64
type Writer = Unblock < File > ;
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ impl RandomHandler {
24
24
}
25
25
}
26
26
27
- #[ crate :: async_trait]
28
27
impl Handler for RandomHandler {
29
28
type Reader = RandomFile ;
30
29
type Writer = Sink ;
You can’t perform that action at this time.
0 commit comments