Skip to content

Commit 34d0a67

Browse files
committed
feat: v5.0.11
1 parent 41556d5 commit 34d0a67

File tree

18 files changed

+45
-69
lines changed

18 files changed

+45
-69
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tcplane"
3-
version = "5.0.10"
3+
version = "5.0.11"
44
readme = "README.md"
55
edition = "2024"
66
authors = ["root@ltpp.vip"]

src/common/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pub(crate) mod r#const;
22
pub(crate) mod r#type;
33

4-
pub use r#const::*;
5-
pub use r#type::*;
4+
pub use {r#const::*, r#type::*};

src/config/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ pub(crate) mod r#struct;
44
pub(crate) mod r#type;
55

66
pub use r#const::*;
7-
pub(crate) use r#struct::*;
8-
pub(crate) use r#type::*;
7+
8+
pub(crate) use {r#struct::*, r#type::*};

src/context/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ pub(crate) mod r#impl;
22
pub(crate) mod r#struct;
33
pub(crate) mod r#type;
44

5-
pub use r#struct::*;
6-
pub use r#type::*;
5+
pub use {r#struct::*, r#type::*};

src/handler/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ pub(crate) mod r#impl;
33
pub(crate) mod r#trait;
44
pub(crate) mod r#type;
55

6-
pub(crate) use r#fn::*;
7-
pub(crate) use r#trait::*;
8-
pub(crate) use r#type::*;
6+
pub(crate) use {r#fn::*, r#trait::*, r#type::*};

src/lib.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//! low-level network connections and data transmission capabilities,
88
//! making it ideal for building modern network services.
99
10-
pub(crate) mod cfg;
1110
pub(crate) mod common;
1211
pub(crate) mod config;
1312
pub(crate) mod context;
@@ -19,19 +18,11 @@ pub(crate) mod server;
1918
pub(crate) mod stream;
2019
pub(crate) mod utils;
2120

22-
pub use config::*;
23-
pub use context::*;
24-
pub use request::*;
25-
pub use response::*;
26-
pub use server::*;
27-
pub use stream::*;
28-
pub use utils::*;
21+
pub use {config::*, context::*, request::*, response::*, server::*, stream::*, utils::*};
2922

3023
pub use tokio;
3124

32-
pub(crate) use common::*;
33-
pub(crate) use handler::*;
34-
pub(crate) use middleware::*;
25+
pub(crate) use {common::*, handler::*, middleware::*};
3526

3627
pub(crate) use std::{
3728
any::Any,
@@ -44,6 +35,7 @@ pub(crate) use std::{
4435
pin::Pin,
4536
sync::Arc,
4637
};
38+
4739
pub(crate) use tokio::{
4840
io::{AsyncReadExt, AsyncWriteExt},
4941
net::{TcpListener, TcpStream},

src/response/error/impl.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/response/error/mod.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/response/impl.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
use crate::*;
22

3+
impl StdError for ResponseError {}
4+
5+
impl Display for ResponseError {
6+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7+
match self {
8+
Self::ResponseError(data) => write!(f, "Response Error{COLON_SPACE}{data}"),
9+
Self::CloseError(data) => write!(f, "Close Error{COLON_SPACE}{data}"),
10+
Self::NotFoundStream => {
11+
write!(f, "Not found stream")
12+
}
13+
Self::Unknown => write!(f, "Unknown"),
14+
}
15+
}
16+
}
17+
318
impl Response {
419
pub fn from<T: Into<ResponseData>>(data: T) -> Self {
520
Self(data.into())

0 commit comments

Comments
 (0)