D code to Rust code


#1

Hi i need help to translate D code to Rust code:

  • alias LogPrintf_fn = void function(immutable(char *) format, );
  • __gshared PluginInterface p; //its a global variable

    extern(System)
    {
    bool Load(ref PluginData data)
    {

    p = PluginInterface.Generate(data);

    }
    }
  • extern(Windows) BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
    {

switch(ulReason) {

		case DLL_PROCESS_ATTACH:
			dll_process_attach(hInstance, true);
			break;
		case DLL_PROCESS_DETACH:
			dll_process_detach(hInstance, true);
			break;
		case DLL_THREAD_ATTACH:
			dll_thread_attach(true, true);
			break;
		case DLL_THREAD_DETACH:
			dll_thread_detach(true, true);
			break;
		default:
	}
	return true;
}