dlopen 0.1.8

Library for opening and operating on dynamic link libraries (also known as shared objects or shared libraries). This is a modern and more flexible alternative to the already existing libraries like libloading or sharedlib
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::super::err::Error;
use super::from_raw::{FromRawResult, RawResult};

impl<'a, T> FromRawResult for Option<T>
where
    T: FromRawResult,
{
    unsafe fn from_raw_result(raw_result: RawResult) -> Result<Option<T>, Error> {
        match T::from_raw_result(raw_result) {
            Ok(val) => Ok(Some(val)),
            Err(_) => Ok(None),
        }
    }
}