pub fn init() {
    static INIT: Once = ONCE_INIT;
    INIT.call_once(|| {
        platform_init();
        unsafe {
            assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);
        }

        // Note that we explicitly don't schedule a call to
        // `curl_global_cleanup`. The documentation for that function says
        //
        // > You must not call it when any other thread in the program (i.e. a
        // > thread sharing the same memory) is running. This doesn't just mean
        // > no other thread that is using libcurl.
        //
        // We can't ever be sure of that, so unfortunately we can't call the
        // function.
    });

    #[cfg(all(unix, not(target_os = "macos"), feature = "ssl"))]
    fn platform_init() {
        openssl_sys::init();
    }

    #[cfg(not(all(unix, not(target_os = "macos"), feature = "ssl")))]
    fn platform_init() {}
}
/// Initializes the underlying libcurl library.
///
/// It's not required to call this before the library is used, but it's
/// recommended to do so as soon as the program starts.
Initializes the underlying libcurl library.
It's not required to call this before the library is used, but it's
recommended to do so as soon as the program starts.
Initializes the underlying libcurl library . It ' s not required to call this before the library is used but it ' s recommended to do so as soon as the program starts .
pub fn init() {
    static INIT: Once = ONCE_INIT;
    INIT.call_once(|| {
        platform_init();
        unsafe {
            assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);
        }
        // Note that we explicitly don't schedule a call to
        // `curl_global_cleanup`. The documentation for that function says
        //
        // > You must not call it when any other thread in the program (i.e. a
        // > thread sharing the same memory) is running. This doesn't just mean
        // > no other thread that is using libcurl.
        //
        // We can't ever be sure of that, so unfortunately we can't call the
        // function.
    });
    #[cfg(all(unix, not(target_os = "macos"), feature = "ssl"))]
    fn platform_init() {
        openssl_sys::init();
    }
    #[cfg(not(all(unix, not(target_os = "macos"), feature = "ssl")))]
    fn platform_init() {}
}
pub fn init ( ) { static INIT : Once = ONCE_INIT ; INIT . call_once ( | | { platform_init ( ) ; unsafe { assert_eq ! ( curl_sys curl_global_init ( curl_sys CURL_GLOBAL_ALL ) 0 ) ; } // Note that we explicitly don't schedule a call to // `curl_global_cleanup`. The documentation for that function says // // > You must not call it when any other thread in the program (i.e. a // > thread sharing the same memory) is running. This doesn't just mean // > no other thread that is using libcurl. // // We can't ever be sure of that, so unfortunately we can't call the // function. } ) ; # [ cfg ( all ( unix not ( target_os " " ) feature " " ) ) ] fn platform_init ( ) { openssl_sys :: init ( ) ; } # [ cfg ( not ( all ( unix not ( target_os " " ) feature " " ) ) ) ] fn platform_init ( ) { } }
Initializes the underlying libcurl library.
Initializes the underlying libcurl library .