File tree Expand file tree Collapse file tree 2 files changed +1
-32
lines changed
Expand file tree Collapse file tree 2 files changed +1
-32
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " tcplane"
3- version = " 5.0.7 "
3+ version = " 5.0.8 "
44readme = " README.md"
55edition = " 2024"
66authors = [" root@ltpp.vip" ]
Original file line number Diff line number Diff line change @@ -24,37 +24,6 @@ To use this crate, you can run cmd:
2424cargo add tcplane
2525```
2626
27- ## Use
28-
29- ``` rust
30- use tcplane :: * ;
31-
32- async fn test_func (ctx : Context ) {
33- ctx . send (" tcplane: 1" ). await . unwrap ();
34- }
35-
36- fn error_handle (error : String ) {
37- eprintln! (" {}" , error );
38- let _ = std :: io :: Write :: flush (& mut std :: io :: stderr ());
39- }
40-
41- #[tokio:: main]
42- async fn main () {
43- let mut server : Server = Server :: new (). await ;
44- server . host (" 0.0.0.0" ). await ;
45- server . port (60000 ). await ;
46- server . buffer (100_024_000 ). await ;
47- server . error_handle (error_handle ). await ;
48- server . func (test_func ). await ;
49- server
50- . func (| ctx : Context | async move {
51- ctx . send (" tcplane: 2" ). await . unwrap ();
52- })
53- . await ;
54- server . run (). await ;
55- }
56- ```
57-
5827## License
5928
6029This project is licensed under the MIT License. See the [ LICENSE] ( LICENSE ) file for details.
You can’t perform that action at this time.
0 commit comments