pub unsafe fn new<P>(path: P) -> Result<DynamicLibraryLoader, LoadingError>
        where P: AsRef<Path>
    {
        let vk_lib = shared_library::dynamic_library::DynamicLibrary::open(Some(path.as_ref()))
            .map_err(LoadingError::LibraryLoadFailure)?;

        let get_proc_addr = {
            let ptr: *mut c_void =
                vk_lib
                    .symbol("vkGetInstanceProcAddr")
                    .map_err(|_| {
                                 LoadingError::MissingEntryPoint("vkGetInstanceProcAddr".to_owned())
                             })?;
            mem::transmute(ptr)
        };

        Ok(DynamicLibraryLoader {
               vk_lib,
               get_proc_addr,
           })
    }
/// Tries to load the dynamic library at the given path, and tries to
/// load `vkGetInstanceProcAddr` in it.
///
/// # Safety
///
/// - The dynamic library must be a valid Vulkan implementation.
///
Tries to load the dynamic library at the given path, and tries to
load `vkGetInstanceProcAddr` in it.
Tries to load the dynamic library at the given path and tries to load ` vkGetInstanceProcAddr ` in it .
pub unsafe fn new<P>(path: P) -> Result<DynamicLibraryLoader, LoadingError>
        where P: AsRef<Path>
    {
        let vk_lib = shared_library::dynamic_library::DynamicLibrary::open(Some(path.as_ref()))
            .map_err(LoadingError::LibraryLoadFailure)?;
        let get_proc_addr = {
            let ptr: *mut c_void =
                vk_lib
                    .symbol("vkGetInstanceProcAddr")
                    .map_err(|_| {
                                 LoadingError::MissingEntryPoint("vkGetInstanceProcAddr".to_owned())
                             })?;
            mem::transmute(ptr)
        };
        Ok(DynamicLibraryLoader {
               vk_lib,
               get_proc_addr,
           })
    }
pub unsafe fn new < P > ( path : P ) -> Result < DynamicLibraryLoader , LoadingError > where P : AsRef < Path > { let vk_lib = shared_library :: dynamic_library :: DynamicLibrary :: open ( Some ( path . as_ref ( ) ) ) . map_err ( LoadingError :: LibraryLoadFailure ) ? ; let get_proc_addr = { let ptr : * mut c_void = vk_lib . symbol ( " " ) . map_err ( | _ | { LoadingError :: MissingEntryPoint ( " " . to_owned ( ) ) } ) ? ; mem :: transmute ( ptr ) } ; Ok ( DynamicLibraryLoader { vk_lib , get_proc_addr , } ) }
Tries to load the dynamic library at the given path, and tries to
load `vkGetInstanceProcAddr` in it.
Tries to load the dynamic library at the given path and tries to load ` vkGetInstanceProcAddr ` in it .
path
P
path
P
safety
The dynamic library must be a valid Vulkan implementation.
The dynamic library must be a valid Vulkan implementation .