impl Display for PortForwardProtocol
This commit is contained in:
		| @@ -1,3 +1,4 @@ | |||||||
|  | use std::fmt::Display; | ||||||
| use std::net::Ipv4Addr; | use std::net::Ipv4Addr; | ||||||
| use std::time::Duration; | use std::time::Duration; | ||||||
|  |  | ||||||
| @@ -93,6 +94,16 @@ impl<'de> Deserialize<'de> for PortForwardProtocol { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | impl Display for PortForwardProtocol { | ||||||
|  |     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||||||
|  |         f.write_str(match self { | ||||||
|  |             PortForwardProtocol::Tcp => "TCP", | ||||||
|  |             PortForwardProtocol::Udp => "UDP", | ||||||
|  |             PortForwardProtocol::Both => "Both", | ||||||
|  |         }) | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| fn bool_from_int<'de, D>(deserializer: D) -> Result<bool, D::Error> | fn bool_from_int<'de, D>(deserializer: D) -> Result<bool, D::Error> | ||||||
| where | where | ||||||
|     D: Deserializer<'de>, |     D: Deserializer<'de>, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user