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: mod.rs
    path of file: ./repos/xiu/protocol/rtmp/src/utils
    
    the code of the file until where you have to start completion: pub mod errors;
pub mod print;

use commonlib::scanf;
use errors::RtmpUrlParseError;
use errors::RtmpUrlParseErrorValue;
use indexmap::IndexMap;

#[derive(Debug, Clone, Default)]
pub struct RtmpUrlParser {
    pub url: String,
    // host_with_port = format!("{}:{}",host,port)
    pub host_with_port: String,
    pub host: String,
    pub port: Option<String>,
 
    
    pub fn parse_stream_name_with_query(stream_name_with_query: &str) -> (String, Option<String>) {
        let data: Vec<&str> = stream_name_with_query.split('?').collect();
        let stream_name = data[0].to_string();
        let query = if data.len() > 1 {
            let query_val = data[1].to_string();

            let mut query_pairs = IndexMap::new();
            let pars_array: Vec<&str> = query_val.split('&').collect();
            for ele in pars_array {
                let (k, v) = scanf!(ele, '=', String, String);
                if k.is_none() || v.is_none() {
                    continue;
                }
                query_pairs.insert(k.unwrap(), v.unwrap());
            }
            Some(data[1].to_string())
        } else {
            None
        };
        (stream_name, query)
    }