pub unsafe fn from_extension_plugin(
        h_instance: raw::HINSTANCE,
        rec: raw::reaper_plugin_info_t,
        static_context: StaticExtensionPluginContext,
    ) -> Result<PluginContext, ContextFromExtensionPluginError> {
        use ContextFromExtensionPluginError::*;
        if rec.caller_version != raw::REAPER_PLUGIN_VERSION as c_int {
            return Err(CallerVersionIncompatible);
        }
        let get_func = rec.GetFunc.ok_or(FunctionProviderNotAvailable)?;
        let register = rec
            .Register
            .expect("plug-in info doesn't container Register function pointer");
        Ok(PluginContext {
            type_specific: TypeSpecificPluginContext::Extension(ExtensionPluginContext {
                caller_version: rec.caller_version,
                hwnd_main: rec.hwnd_main,
                register,
                get_func,
            }),
            h_instance,
            get_swell_func_ptr: static_context.get_swell_func,
            main_thread_id: std::thread::current().id(),
        })
    }
/// Creates a plug-in context from an extension entry point plug-in info.
///
/// It requires a module handle and the pointer to a [`reaper_plugin_info_t`] struct. REAPER
/// provides both when calling the `ReaperPluginEntry` function (the main entry point for
/// any extension plug-in).
///
/// It's recommended to use the `reaper_extension_plugin` macro in the
/// [reaper-macros](https://crates.io/crates/reaper-macros) crate instead of calling
/// this function directly.
///
/// # Errors
///
/// Returns an error if the given plug-in info is not suitable for loading REAPER functions.
///
/// # Safety
///
/// REAPER can crash if you pass an invalid pointer.
///
/// [`reaper_plugin_info_t`]: raw/struct.reaper_plugin_info_t.html
Creates a plug-in context from an extension entry point plug-in info.
It requires a module handle and the pointer to a [`reaper_plugin_info_t`] struct. REAPER
provides both when calling the `ReaperPluginEntry` function (the main entry point for
any extension plug-in).

It's recommended to use the `reaper_extension_plugin` macro in the
[reaper-macros] crate instead of calling
this function directly.
Creates a plug - in context from an extension entry point plug - in info . It requires a module handle and the pointer to a [ ` reaper_plugin_info_t ` ] struct . REAPER provides both when calling the ` ReaperPluginEntry ` function ( the main entry point for any extension plug - in ) . It ' s recommended to use the ` reaper_extension_plugin ` macro in the [ reaper - macros ] crate instead of calling this function directly .
pub unsafe fn from_extension_plugin(
        h_instance: raw::HINSTANCE,
        rec: raw::reaper_plugin_info_t,
        static_context: StaticExtensionPluginContext,
    ) -> Result<PluginContext, ContextFromExtensionPluginError> {
        use ContextFromExtensionPluginError::*;
        if rec.caller_version != raw::REAPER_PLUGIN_VERSION as c_int {
            return Err(CallerVersionIncompatible);
        }
        let get_func = rec.GetFunc.ok_or(FunctionProviderNotAvailable)?;
        let register = rec
            .Register
            .expect("plug-in info doesn't container Register function pointer");
        Ok(PluginContext {
            type_specific: TypeSpecificPluginContext::Extension(ExtensionPluginContext {
                caller_version: rec.caller_version,
                hwnd_main: rec.hwnd_main,
                register,
                get_func,
            }),
            h_instance,
            get_swell_func_ptr: static_context.get_swell_func,
            main_thread_id: std::thread::current().id(),
        })
    }
pub unsafe fn from_extension_plugin ( h_instance : raw :: HINSTANCE , rec : raw :: reaper_plugin_info_t , static_context : StaticExtensionPluginContext , ) -> Result < PluginContext , ContextFromExtensionPluginError > { use ContextFromExtensionPluginError :: * ; if rec . caller_version != raw :: REAPER_PLUGIN_VERSION as c_int { return Err ( CallerVersionIncompatible ) ; } let get_func = rec . GetFunc . ok_or ( FunctionProviderNotAvailable ) ? ; let register = rec . Register . expect ( " " ) ; Ok ( PluginContext { type_specific : TypeSpecificPluginContext :: Extension ( ExtensionPluginContext { caller_version : rec . caller_version , hwnd_main : rec . hwnd_main , register , get_func , } ) , h_instance , get_swell_func_ptr : static_context . get_swell_func , main_thread_id : std :: thread :: current ( ) . id ( ) , } ) }
Creates a plug-in context from an extension entry point plug-in info.
Creates a plug - in context from an extension entry point plug - in info .
h_instance
raw::HINSTANCE
rec
raw::reaper_plugin_info_t
static_context
StaticExtensionPluginContext
h_instance
raw::HINSTANCE
rec
raw::reaper_plugin_info_t
static_context
StaticExtensionPluginContext
errors
Returns an error if the given plug-in info is not suitable for loading REAPER functions.
Returns an error if the given plug - in info is not suitable for loading REAPER functions .
safety
REAPER can crash if you pass an invalid pointer.

[`reaper_plugin_info_t`]: raw/struct.reaper_plugin_info_t.html
REAPER can crash if you pass an invalid pointer . [ ` reaper_plugin_info_t ` ] : raw / struct . reaper_plugin_info_t . html