fn load_library(path: &Path) -> Result<Library, Error> {
        debug!("loading shared library: {}", path.display());

        let library = match Library::new(path) {
            Ok(v) => v,
            Err(_) => return Err(Error::LoadLibraryError),
        };

        // Sanity check: verify ingot API is compatible.
        let library_version = unsafe {
            let symbol: Symbol<*mut u16> = library.get(b"INGOTS_VERSION\0").expect("error loading ingot ABI version");
            **symbol
        };

        debug!("shared library has ingots version: {}", library_version);

        if library_version != INGOTS_VERSION {
            return Err(Error::VersionMismatch);
        }

        Ok(library)
    }
/// Load a shared library object.
Load a shared library object.
Load a shared library object .
fn load_library(path: &Path) -> Result<Library, Error> {
        debug!("loading shared library: {}", path.display());
        let library = match Library::new(path) {
            Ok(v) => v,
            Err(_) => return Err(Error::LoadLibraryError),
        };
        // Sanity check: verify ingot API is compatible.
        let library_version = unsafe {
            let symbol: Symbol<*mut u16> = library.get(b"INGOTS_VERSION\0").expect("error loading ingot ABI version");
            **symbol
        };
        debug!("shared library has ingots version: {}", library_version);
        if library_version != INGOTS_VERSION {
            return Err(Error::VersionMismatch);
        }
        Ok(library)
    }
fn load_library ( path : & Path ) -> Result < Library , Error > { debug ! ( " " path display ( ) ) ; let library = match Library :: new ( path ) { Ok ( v ) => v , Err ( _ ) => return Err ( Error :: LoadLibraryError ) , } ; // Sanity check: verify ingot API is compatible. let library_version = unsafe { let symbol : Symbol < * mut u16 > = library . get ( b" \0 " ) . expect ( " " ) ; * * symbol } ; debug ! ( " " library_version ) ; if library_version != INGOTS_VERSION { return Err ( Error :: VersionMismatch ) ; } Ok ( library ) }
Load a shared library object.
Load a shared library object .
path
&Path
path
&Path