tls_api_stub/lib.rs
1//! Stub implementation of TLS API.
2//!
3//! All operations return error. No objects can be instantiated.
4//!
5//! Can be useful when you need a type parameter of type e. g. `TlsConnector`:
6//!
7//! ```
8//! use tls_api_stub_2::TlsConnector;
9//!
10//! let no_connector: Option<TlsConnector> = None;
11//! ```
12
13#![deny(rustdoc::broken_intra_doc_links)]
14
15pub use acceptor::TlsAcceptor;
16pub use acceptor::TlsAcceptorBuilder;
17pub use connector::TlsConnector;
18pub use connector::TlsConnectorBuilder;
19pub use stream::TlsStream;
20
21use tls_api::ImplInfo;
22
23mod stream;
24
25mod acceptor;
26mod connector;
27
28#[derive(Debug, thiserror::Error)]
29#[error("stub implementation")]
30struct Error;
31
32pub(crate) fn info() -> ImplInfo {
33 ImplInfo {
34 name: "stub",
35 version: "none",
36 }
37}