mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-21 00:20:53 +00:00
refine TunToProxy struct
This commit is contained in:
parent
7dec7f59f1
commit
ad388f897a
5 changed files with 41 additions and 40 deletions
16
src/error.rs
16
src/error.rs
|
@ -15,6 +15,22 @@ impl From<std::io::Error> for Error {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<std::net::AddrParseError> for Error {
|
||||
fn from(err: std::net::AddrParseError) -> Self {
|
||||
Self {
|
||||
message: err.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<smoltcp::iface::RouteTableFull> for Error {
|
||||
fn from(err: smoltcp::iface::RouteTableFull) -> Self {
|
||||
Self {
|
||||
message: format!("{err:?}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&str> for Error {
|
||||
fn from(err: &str) -> Self {
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue