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: split_connection.rs
    path of file: ./repos/amqprs/amqprs/src/net
    
    the code of the file until where you have to start completion: use crate::frame::{
    ContentBody, Frame, FrameHeader, FRAME_CONTENT_BODY, FRAME_END, FRAME_HEADER_SIZE,
};

use amqp_serde::{
    to_buffer,
    types::{AmqpChannelId, LongUint},
};
use bytes::{Buf, BufMut, BytesMut};
use serde::Serialize;
use std::{
    io::{self, Cursor},
    pin::Pin,
};
use tokio::{
    io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadHalf, WriteHalf},
    net::TcpStream,
};
#[cfg(feature = "tls")]
use tokio_rustls::{client::TlsStream, rustls, TlsConnector};
#[cfg(feature = "traces")]
use tracing::trace;

use super::Error;
type Result<T> = std::result::Result<T, Error>;
const DEFAULT_IO_BUFFER_SIZE: usize = 8192;

pub(crate) struct SplitConnection {
    reader: BufIoReader,
    writer: BufIoWriter,
}
pub(crate) struct BufIoReader {
    stream: ReadHalf<SplitIoStream>,
    buff
    
    pub async fn open_tls(addr: &str, domain: &str, connector: &TlsConnector) -> Result<Self> {
        let domain = rustls::ServerName::try_from(domain)
            .map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid dnsname"))?;

        let stream = connector
            .connect(domain, TcpStream::connect(addr).await?)
            .await?;
        let stream: SplitIoStream = stream.into();
        let (reader, writer) = tokio::io::split(stream);

        let read_buffer = BytesMut::with_capacity(DEFAULT_IO_BUFFER_SIZE);
        let write_buffer = BytesMut::with_capacity(DEFAULT_IO_BUFFER_SIZE);

        Ok(Self {
            reader: BufIoReader {
                stream: reader,
                buffer: read_buffer,
            },
            writer: BufIoWriter {
                stream: writer,
                buffer: write_buffer,
            },
        })
    }