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: schema_registry.rs
    path of file: ./repos/dozer/dozer-ingestion/kafka/src/debezium
    
    the code of the file until where you have to start completion: use std::collections::HashMap;

use dozer_ingestion_connector::dozer_types::log::error;
use dozer_ingestion_connector::dozer_types::serde_json::{self, Value};
use dozer_ingestion_connector::dozer_types::types::{
    FieldDefinition, FieldType, Schema, SourceDefinition,
};
use dozer_ingestion_connector::{tokio, CdcType, SourceSchema};
use schema_registry_converter::async_impl::schema_registry::SrSettings;
use schema_registry_converter::schema_registry_common::SubjectNameStrategy;

use crate::{KafkaError, KafkaSchemaError};

use super::schema::map_type;
use super::stream_consumer::DebeziumSchemaStruct;

pub struct SchemaRegistry {}

impl SchemaRegistry {
    pub fn map_typ(schema: &DebeziumSchemaStruct) -> Result<(FieldType, bool), KafkaSchemaError> {
        let nullable = schema.optional.map_or(false, |o| !o);
        match schema.r#type.clone() {
            Value::String(_) => map_type(&DebeziumSchemaStruct {
                r#type: schema.r#type.clone(),
                fields: None,
                optional: None,
                name: None,
                field: None,
                version: None,
                parameters: None,
            })
            .map(|
    
    pub fn map_typ(schema: &DebeziumSchemaStruct) -> Result<(FieldType, bool), KafkaSchemaError> {
        let nullable = schema.optional.map_or(false, |o| !o);
        match schema.r#type.clone() {
            Value::String(_) => map_type(&DebeziumSchemaStruct {
                r#type: schema.r#type.clone(),
                fields: None,
                optional: None,
                name: None,
                field: None,
                version: None,
                parameters: None,
            })
            .map(|s| (s, nullable)),
            Value::Array(types) => {
                let nullable = types.contains(&Value::from("null"));
                for typ in types {
                    if typ.as_str().unwrap() != "null" {
                        return Self::map_typ(&DebeziumSchemaStruct {
                            r#type: typ,
                            fields: None,
                            optional: Some(nullable),
                            name: None,
                            field: None,
                            version: None,
                            parameters: None,
                        });
                    }
                }

                Err(KafkaSchemaError::TypeNotSupported("Array".to_string()))
            }
            Value::Object(obj) => SchemaRegistry::map_typ(&DebeziumSchemaStruct {
                r#type: obj.get("type").unwrap().clone(),
                fields: None,
                optional: None,
                name: None,
                field: None,
                version: None,
                parameters: None,
            }),
            _ => Err(KafkaSchemaError::TypeNotSupported(
                "Unexpected value".to_string(),
            )),
        }
    }