Convert one variable type to another type from winreg

Hello,

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?

//main.rs
    registry::get_value ("HKEY_LOCAL_MACHINE".to_string());
//registry.rs
    pub fn get_value(root: String, key: String, subkey: String) -> String
    {
    	let root: HKEY = root.a_cool_convert_string_to_HKEY_function_smile();
    	"fooBar".to_string()
    }

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