File tree Expand file tree Collapse file tree 6 files changed +8
-13
lines changed Expand file tree Collapse file tree 6 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 22name = " async-tftp"
33version = " 0.3.6"
44authors = [" oblique <psyberbits@gmail.com>" ]
5- edition = " 2018"
5+ edition = " 2021"
6+ rust-version = " 1.75"
67license = " MIT"
78readme = " README.md"
89
@@ -20,7 +21,6 @@ thiserror = "1.0.48"
2021async-executor = " 1.5.1"
2122async-io = " 1.13.0"
2223async-lock = " 2.8.0"
23- async-trait = " 0.1.73"
2424blocking = " 1.3.1"
2525futures-lite = " 1.13.0"
2626
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ fn strip_path_prefixes(path: &Path) -> &Path {
2929 path. strip_prefix ( "/" ) . or_else ( |_| path. strip_prefix ( "./" ) ) . unwrap_or ( path)
3030}
3131
32- #[ async_tftp:: async_trait]
3332impl Handler for TftpdTarGzHandler {
3433 type Reader = Entry < Archive < GzipDecoder < BufReader < File > > > > ;
3534 type Writer = Sink ;
Original file line number Diff line number Diff line change @@ -67,6 +67,3 @@ mod tests;
6767mod utils;
6868
6969pub 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 11use futures_lite:: { AsyncRead , AsyncWrite } ;
2+ use std:: future:: Future ;
23use std:: net:: SocketAddr ;
34use std:: path:: Path ;
45
56use crate :: packet;
67
78/// Trait for implementing advance handlers.
8- #[ crate :: async_trait]
99pub trait Handler : Send {
1010 type Reader : AsyncRead + Unpin + Send + ' static ;
1111 type Writer : AsyncWrite + Unpin + Send + ' static ;
1212
1313 /// Open `Reader` to serve a read request.
14- async fn read_req_open (
14+ fn read_req_open (
1515 & mut self ,
1616 client : & SocketAddr ,
1717 path : & Path ,
18- ) -> Result < ( Self :: Reader , Option < u64 > ) , packet:: Error > ;
18+ ) -> impl Future < Output = Result < ( Self :: Reader , Option < u64 > ) , packet:: Error > >
19+ + Send ;
1920
2021 /// Open `Writer` to serve a write request.
21- async fn write_req_open (
22+ fn write_req_open (
2223 & mut self ,
2324 client : & SocketAddr ,
2425 path : & Path ,
2526 size : Option < u64 > ,
26- ) -> Result < Self :: Writer , packet:: Error > ;
27+ ) -> impl Future < Output = Result < Self :: Writer , packet:: Error > > + Send ;
2728}
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ impl DirHandler {
5959 }
6060}
6161
62- #[ crate :: async_trait]
6362impl crate :: server:: Handler for DirHandler {
6463 type Reader = Unblock < File > ;
6564 type Writer = Unblock < File > ;
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ impl RandomHandler {
2424 }
2525}
2626
27- #[ crate :: async_trait]
2827impl Handler for RandomHandler {
2928 type Reader = RandomFile ;
3029 type Writer = Sink ;
You can’t perform that action at this time.
0 commit comments