@@ -26,7 +26,7 @@ impl fmt::Display for Protocol {
2626}
2727
2828#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize , Hash ) ]
29- pub enum AddressType {
29+ pub enum IpType {
3030 /// Represents a plain IPv4 or IPv6 address.
3131 Plain ,
3232
@@ -38,7 +38,7 @@ pub enum AddressType {
3838 V4MappedV6 ,
3939}
4040
41- impl fmt:: Display for AddressType {
41+ impl fmt:: Display for IpType {
4242 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
4343 let addr_type_str = match self {
4444 Self :: Plain => "plain" ,
@@ -120,12 +120,12 @@ impl ServiceBinding {
120120 }
121121
122122 #[ must_use]
123- pub fn bind_address_type ( & self ) -> AddressType {
123+ pub fn bind_address_ip_type ( & self ) -> IpType {
124124 if self . is_v4_mapped_v6 ( ) {
125- return AddressType :: V4MappedV6 ;
125+ return IpType :: V4MappedV6 ;
126126 }
127127
128- AddressType :: Plain
128+ IpType :: Plain
129129 }
130130
131131 /// # Panics
@@ -169,7 +169,7 @@ mod tests {
169169 use rstest:: rstest;
170170 use url:: Url ;
171171
172- use crate :: service_binding:: { AddressType , Error , Protocol , ServiceBinding } ;
172+ use crate :: service_binding:: { Error , IpType , Protocol , ServiceBinding } ;
173173
174174 #[ rstest]
175175 #[ case( "wildcard_ip" , Protocol :: UDP , SocketAddr :: from_str( "0.0.0.0:6969" ) . unwrap( ) ) ]
@@ -203,23 +203,23 @@ mod tests {
203203 fn should_return_the_bind_address_plain_type_for_ipv4_ips ( ) {
204204 let service_binding = ServiceBinding :: new ( Protocol :: UDP , SocketAddr :: from_str ( "127.0.0.1:6969" ) . unwrap ( ) ) . unwrap ( ) ;
205205
206- assert_eq ! ( service_binding. bind_address_type ( ) , AddressType :: Plain ) ;
206+ assert_eq ! ( service_binding. bind_address_ip_type ( ) , IpType :: Plain ) ;
207207 }
208208
209209 #[ test]
210210 fn should_return_the_bind_address_plain_type_for_ipv6_ips ( ) {
211211 let service_binding =
212212 ServiceBinding :: new ( Protocol :: UDP , SocketAddr :: from_str ( "[0:0:0:0:0:0:0:1]:6969" ) . unwrap ( ) ) . unwrap ( ) ;
213213
214- assert_eq ! ( service_binding. bind_address_type ( ) , AddressType :: Plain ) ;
214+ assert_eq ! ( service_binding. bind_address_ip_type ( ) , IpType :: Plain ) ;
215215 }
216216
217217 #[ test]
218218 fn should_return_the_bind_address_v4_mapped_v7_type_for_ipv4_ips_mapped_to_ipv6 ( ) {
219219 let service_binding =
220220 ServiceBinding :: new ( Protocol :: UDP , SocketAddr :: from_str ( "[::ffff:192.0.2.33]:6969" ) . unwrap ( ) ) . unwrap ( ) ;
221221
222- assert_eq ! ( service_binding. bind_address_type ( ) , AddressType :: V4MappedV6 ) ;
222+ assert_eq ! ( service_binding. bind_address_ip_type ( ) , IpType :: V4MappedV6 ) ;
223223 }
224224
225225 #[ test]
0 commit comments