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: mime.rs
    path of file: ./repos/tremor-runtime/src/connectors/utils
    
    the code of the file until where you have to start completion: // Copyright 2022, The Tremor Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the Lice
    
    pub(crate) fn from_custom(by_mime: HashMap<String, NameWithConfig>) -> Self {
        // We use the existing codec -> mimetype mapping as default to ensure that each
        // codec at least maps to a mime type
        let mut by_codec = CODEC_TO_MIME_TYPES
            .into_iter()
            .map(|(k, v)| (k.to_string(), v.to_string()))
            .collect::<HashMap<String, String>>();

        // After that we overwrite / extend the mapping with the definition given
        // by the user
        for (mime, codec_name) in &by_mime {
            if mime != "*/*" {
                by_codec.insert(codec_name.name.clone(), mime.clone());
            }
        }

        Self { by_mime, by_codec }
    }