rustls_mbedtls_provider_utils/
lib.rs

1//! This crate provides common util code used in `rustls-mbedcrypto-provider` and `rustls-mbedpki-provider`
2
3// Require docs for public APIs, deny unsafe code, etc.
4#![forbid(unsafe_code, unused_must_use)]
5#![cfg_attr(not(bench), forbid(unstable_features))]
6#![deny(
7    clippy::alloc_instead_of_core,
8    clippy::clone_on_ref_ptr,
9    clippy::std_instead_of_core,
10    clippy::use_self,
11    clippy::upper_case_acronyms,
12    trivial_casts,
13    trivial_numeric_casts,
14    missing_docs,
15    unreachable_pub,
16    unused_import_braces,
17    unused_extern_crates,
18    unused_qualifications
19)]
20// Enable documentation for all features on docs.rs
21#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
22#![cfg_attr(bench, feature(test))]
23#![cfg_attr(not(test), no_std)]
24
25extern crate alloc;
26
27// This `extern crate` plus the `#![no_std]` attribute changes the default prelude from
28// `std::prelude` to `core::prelude`. That forces one to _explicitly_ import (`use`) everything that
29// is in `std::prelude` but not in `core::prelude`. This helps maintain no-std support as even
30// developers that are not interested in, or aware of, no-std support and / or that never run
31// `cargo build --no-default-features` locally will get errors when they rely on `std::prelude` API.
32#[cfg(not(test))]
33extern crate std;
34
35/// Utility code related to error types: [`mbedtls::Error`] and [`rustls::Error`]
36pub mod error;
37/// Utility code related to [`mbedtls::hash`] types
38pub mod hash;
39/// Utility code related to [`mbedtls::pk`] types
40pub mod pk;