Coverage Report

Created: 2026-05-18 06:32

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/git/checkouts/nss-rs-71e20fe79ef91440/9b94ca3/src/exp.rs
Line
Count
Source
1
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
2
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4
// option. This file may not be copied, modified, or distributed
5
// except according to those terms.
6
7
#[macro_export]
8
macro_rules! experimental_api {
9
    ( $n:ident ( $( $a:ident : $t:ty ),* $(,)? ) ) => {
10
        #[expect(non_snake_case, reason = "Inherent in macro use.")]
11
        #[allow(clippy::allow_attributes, clippy::too_many_arguments, reason = "Inherent in macro use.")]
12
        #[allow(clippy::allow_attributes, clippy::missing_safety_doc, reason = "Inherent in macro use.")]
13
        #[allow(clippy::allow_attributes, clippy::missing_errors_doc, reason = "Inherent in macro use.")]
14
70.2k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
70.2k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
30
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
30
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
30
            });
nss_rs::hp::SSL_HkdfExpandLabelWithMech::{closure#0}
Line
Count
Source
19
4
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
4
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
4
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
4
            });
Unexecuted instantiation: nss_rs::ech::SSL_EncodeEchConfigId::{closure#0}
Unexecuted instantiation: nss_rs::ech::SSL_GetEchRetryConfigs::{closure#0}
Unexecuted instantiation: nss_rs::ech::SSL_SetClientEchConfigs::{closure#0}
Unexecuted instantiation: nss_rs::ech::SSL_SetServerEchConfigs::{closure#0}
Unexecuted instantiation: nss_rs::ech::SSL_EnableTls13GreaseEch::{closure#0}
nss_rs::ext::SSL_InstallExtensionHooks::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
Unexecuted instantiation: nss_rs::ext::SSL_CallExtensionWriterOnEchInner::{closure#0}
nss_rs::ssl::SSL_RecordLayerData::{closure#0}
Line
Count
Source
19
1
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
1
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
1
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
1
            });
Unexecuted instantiation: nss_rs::ssl::SSL_SendSessionTicket::{closure#0}
Unexecuted instantiation: nss_rs::ssl::SSL_SetResumptionToken::{closure#0}
nss_rs::ssl::SSL_SetMaxEarlyDataSize::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
Unexecuted instantiation: nss_rs::ssl::SSL_GetResumptionTokenInfo::{closure#0}
nss_rs::ssl::SSL_RecordLayerWriteCallback::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
nss_rs::ssl::SSL_HelloRetryRequestCallback::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
Unexecuted instantiation: nss_rs::ssl::SSL_DestroyResumptionTokenInfo::{closure#0}
nss_rs::ssl::SSL_SetResumptionTokenCallback::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
Unexecuted instantiation: nss_rs::ssl::SSL_SetCertificateCompressionAlgorithm::{closure#0}
Unexecuted instantiation: nss_rs::cert::SSL_PeerCertificateChainDER::{closure#0}
nss_rs::hkdf::SSL_HkdfExtract::{closure#0}
Line
Count
Source
19
3
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
3
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
3
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
3
            });
nss_rs::hkdf::SSL_HkdfExpandLabel::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
nss_rs::time::SSL_SetTimeFunc::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
nss_rs::replay::SSL_SetAntiReplayContext::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
nss_rs::replay::SSL_CreateAntiReplayContext::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
nss_rs::replay::SSL_ReleaseAntiReplayContext::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
nss_rs::secrets::SSL_SecretCallback::{closure#0}
Line
Count
Source
19
2
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
2
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
2
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
2
            });
24
70.2k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
70.2k
            }
27
70.2k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
70.2k
            let rv = f( $( $a ),* );
29
70.2k
            $crate::err::secstatus_to_res(rv)
30
70.2k
        }}
nss_rs::hp::SSL_HkdfExpandLabelWithMech
Line
Count
Source
14
32.4k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
32.4k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
32.4k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
32.4k
            }
27
32.4k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
32.4k
            let rv = f( $( $a ),* );
29
32.4k
            $crate::err::secstatus_to_res(rv)
30
32.4k
        }}
Unexecuted instantiation: nss_rs::ech::SSL_EncodeEchConfigId
Unexecuted instantiation: nss_rs::ech::SSL_GetEchRetryConfigs
Unexecuted instantiation: nss_rs::ech::SSL_SetClientEchConfigs
Unexecuted instantiation: nss_rs::ech::SSL_SetServerEchConfigs
Unexecuted instantiation: nss_rs::ech::SSL_EnableTls13GreaseEch
nss_rs::ext::SSL_InstallExtensionHooks
Line
Count
Source
14
2.57k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
2.57k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
2.57k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
2.57k
            }
27
2.57k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
2.57k
            let rv = f( $( $a ),* );
29
2.57k
            $crate::err::secstatus_to_res(rv)
30
2.57k
        }}
Unexecuted instantiation: nss_rs::ext::SSL_CallExtensionWriterOnEchInner
nss_rs::ssl::SSL_RecordLayerData
Line
Count
Source
14
484
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
484
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
484
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
484
            }
27
484
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
484
            let rv = f( $( $a ),* );
29
484
            $crate::err::secstatus_to_res(rv)
30
484
        }}
Unexecuted instantiation: nss_rs::ssl::SSL_SendSessionTicket
Unexecuted instantiation: nss_rs::ssl::SSL_SetResumptionToken
nss_rs::ssl::SSL_SetMaxEarlyDataSize
Line
Count
Source
14
1.28k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
1.28k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
1.28k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
1.28k
            }
27
1.28k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
1.28k
            let rv = f( $( $a ),* );
29
1.28k
            $crate::err::secstatus_to_res(rv)
30
1.28k
        }}
Unexecuted instantiation: nss_rs::ssl::SSL_GetResumptionTokenInfo
nss_rs::ssl::SSL_RecordLayerWriteCallback
Line
Count
Source
14
3.54k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
3.54k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
3.54k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
3.54k
            }
27
3.54k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
3.54k
            let rv = f( $( $a ),* );
29
3.54k
            $crate::err::secstatus_to_res(rv)
30
3.54k
        }}
nss_rs::ssl::SSL_HelloRetryRequestCallback
Line
Count
Source
14
1.28k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
1.28k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
1.28k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
1.28k
            }
27
1.28k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
1.28k
            let rv = f( $( $a ),* );
29
1.28k
            $crate::err::secstatus_to_res(rv)
30
1.28k
        }}
Unexecuted instantiation: nss_rs::ssl::SSL_DestroyResumptionTokenInfo
nss_rs::ssl::SSL_SetResumptionTokenCallback
Line
Count
Source
14
1.28k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
1.28k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
1.28k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
1.28k
            }
27
1.28k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
1.28k
            let rv = f( $( $a ),* );
29
1.28k
            $crate::err::secstatus_to_res(rv)
30
1.28k
        }}
Unexecuted instantiation: nss_rs::ssl::SSL_SetCertificateCompressionAlgorithm
Unexecuted instantiation: nss_rs::cert::SSL_PeerCertificateChainDER
nss_rs::hkdf::SSL_HkdfExtract
Line
Count
Source
14
9.47k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
9.47k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
9.47k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
9.47k
            }
27
9.47k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
9.47k
            let rv = f( $( $a ),* );
29
9.47k
            $crate::err::secstatus_to_res(rv)
30
9.47k
        }}
nss_rs::hkdf::SSL_HkdfExpandLabel
Line
Count
Source
14
9.65k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
9.65k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
9.65k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
9.65k
            }
27
9.65k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
9.65k
            let rv = f( $( $a ),* );
29
9.65k
            $crate::err::secstatus_to_res(rv)
30
9.65k
        }}
nss_rs::time::SSL_SetTimeFunc
Line
Count
Source
14
2.57k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
2.57k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
2.57k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
2.57k
            }
27
2.57k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
2.57k
            let rv = f( $( $a ),* );
29
2.57k
            $crate::err::secstatus_to_res(rv)
30
2.57k
        }}
nss_rs::replay::SSL_SetAntiReplayContext
Line
Count
Source
14
1.28k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
1.28k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
1.28k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
1.28k
            }
27
1.28k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
1.28k
            let rv = f( $( $a ),* );
29
1.28k
            $crate::err::secstatus_to_res(rv)
30
1.28k
        }}
nss_rs::replay::SSL_CreateAntiReplayContext
Line
Count
Source
14
1.28k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
1.28k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
1.28k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
1.28k
            }
27
1.28k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
1.28k
            let rv = f( $( $a ),* );
29
1.28k
            $crate::err::secstatus_to_res(rv)
30
1.28k
        }}
nss_rs::replay::SSL_ReleaseAntiReplayContext
Line
Count
Source
14
1.28k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
1.28k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
1.28k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
1.28k
            }
27
1.28k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
1.28k
            let rv = f( $( $a ),* );
29
1.28k
            $crate::err::secstatus_to_res(rv)
30
1.28k
        }}
nss_rs::secrets::SSL_SecretCallback
Line
Count
Source
14
1.77k
        pub unsafe fn $n ( $( $a : $t ),* ) -> Result<(), $crate::err::Error> { unsafe {
15
            struct ExperimentalAPI(*mut std::ffi::c_void);
16
            unsafe impl Send for ExperimentalAPI {}
17
            unsafe impl Sync for ExperimentalAPI {}
18
            static EXP_API: ::std::sync::OnceLock<ExperimentalAPI> = ::std::sync::OnceLock::new();
19
1.77k
            let f = EXP_API.get_or_init(|| {
20
                const EXP_FUNCTION: &str = stringify!($n);
21
                let Ok(n) = ::std::ffi::CString::new(EXP_FUNCTION) else { return ExperimentalAPI(std::ptr::null_mut()); };
22
                ExperimentalAPI($crate::ssl::SSL_GetExperimentalAPI(n.as_ptr()))
23
            });
24
1.77k
            if f.0.is_null() {
25
0
                return Err($crate::err::Error::Internal);
26
1.77k
            }
27
1.77k
            let f: unsafe extern "C" fn( $( $t ),* ) -> $crate::SECStatus = ::std::mem::transmute(f.0);
28
1.77k
            let rv = f( $( $a ),* );
29
1.77k
            $crate::err::secstatus_to_res(rv)
30
1.77k
        }}
31
    };
32
}