File: macros.rs

package info (click to toggle)
rust-rustls 0.23.26%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,816 kB
  • sloc: sh: 199; python: 181; makefile: 23
file content (45 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Macros that bring a provider into the current scope.
//!
//! The selected provider module is bound as `provider`; you can rely on this
//! having the union of the public items common to the `rustls::crypto::ring`
//! and `rustls::crypto::aws_lc_rs` modules.

#[allow(unused_macros)]
macro_rules! provider_ring {
    () => {
        #[allow(unused_imports)]
        use rustls::crypto::ring as provider;
        #[allow(dead_code)]
        const fn provider_is_aws_lc_rs() -> bool {
            false
        }
        #[allow(dead_code)]
        const fn provider_is_ring() -> bool {
            true
        }
        #[allow(dead_code)]
        const fn provider_is_fips() -> bool {
            false
        }
    };
}

#[allow(unused_macros)]
macro_rules! provider_aws_lc_rs {
    () => {
        #[allow(unused_imports)]
        use rustls::crypto::aws_lc_rs as provider;
        #[allow(dead_code)]
        const fn provider_is_aws_lc_rs() -> bool {
            true
        }
        #[allow(dead_code)]
        const fn provider_is_ring() -> bool {
            false
        }
        #[allow(dead_code)]
        const fn provider_is_fips() -> bool {
            cfg!(feature = "fips")
        }
    };
}