You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: proxy_protocol.rs
    path of file: ./repos/diem/network/netcore/src/transport
    
    the code of the file until where you have to start completion: // Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

//! # An implementation of ProxyProtocol for HAProxy
//! https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
//!
//! ## Limitations
//! - Only supports ProxyProtocol V2
//! - Rejects ProxyProtocol V1
//! - Only supports IPv4 & IPv6 TCP mode
//! - All other valid connections, will just drop the address information and use the proxy's one
//! - Does not interpret TLVs
//!
//! ## Interpetations not in the spec
//! - An address space that doesn't match the size expected is rejected e.g. too big for IPv4
//! - Address space that's larger than the current supported requests is rejected

use diem_types::network_address::NetworkAddress;
use futures::io::
    
    fn test_ipv4_proxy_protocol() {
        let (mut sender, mut receiver) = MemorySocket::new_pair();
        let original_addr = NetworkAddress::mock();

        let server = async move {
            send_v4(&mut sender).await.expect("Successful send");
        };

        let reader = read_header(&original_addr, &mut receiver);

        // Verify the correct address is picked up
        let client = async move {
            let addr = reader.await.expect("An address");
            let addresses: Vec<_> = addr.to_socket_addrs().unwrap().collect();
            let socket_addr = addresses.first().unwrap();
            assert_eq!(IpAddr::V4(Ipv4Addr::from(0x0000000001)), socket_addr.ip());
            assert_eq!(80, socket_addr.port());
        };

        block_on(join(server, client));

        // Check that data wrapped isn't affected
        let check_data = async move {
            let data: &mut [u8; 4] = &mut [0; 4];
            receiver.read_exact(data).await.unwrap();
            assert_eq!(TEST_DATA, data);
        };

        block_on(check_data);
    }