Convert one variable type to another type from winreg


some little basics. I give an function an String and in this function i want to be convert this String in another variabletype. See i that right that every crate/module must have its own variable converting functions, or implement std-functions?

    registry::get_value ("HKEY_LOCAL_MACHINE".to_string());
    pub fn get_value(root: String, key: String, subkey: String) -> String
    	let root: HKEY = root.a_cool_convert_string_to_HKEY_function_smile();

Yes i can do it in the but i want to capsule all registry needs in the so that i can use complete isolated from the rest and use another crate in the future.