#tls #operation #tls-connector

tls-api-stub

TLS API implementation that returns error on any operation

27 releases

0.12.1 Nov 25, 2024
0.9.0 Apr 28, 2022
0.7.0 Oct 26, 2021
0.5.0 Feb 21, 2021
0.1.8 Jun 17, 2017

#342 in Testing

Download history 4404/week @ 2024-12-05 3960/week @ 2024-12-12 2562/week @ 2024-12-19 1945/week @ 2024-12-26 3285/week @ 2025-01-02 3776/week @ 2025-01-09 3856/week @ 2025-01-16 3815/week @ 2025-01-23 4110/week @ 2025-01-30 4384/week @ 2025-02-06 4156/week @ 2025-02-13 4229/week @ 2025-02-20 4319/week @ 2025-02-27 5413/week @ 2025-03-06 5613/week @ 2025-03-13 5135/week @ 2025-03-20

21,315 downloads per month
Used in 22 crates (6 directly)

MIT/Apache

76KB
1.5K SLoC

tls-api-stub

Stub implementation of tls-api. All operations return an error.

Useful when you need an implementation of type like TlsConnector, but you do not intend to use it.

E. g.

fn connect<C : tls_api::TlsConnector>(host: &str, use_tls: bool) { ... }

So if the function is to be used without TLS, it can be called with stub implementation:

connect::<tls_api_stub::TlsConnector>("database", false);

lib.rs:

Stub implementation of TLS API.

All operations return error. No objects can be instantiated.

Can be useful when you need a type parameter of type e. g. TlsConnector:

use tls_api_stub_2::TlsConnector;

let no_connector: Option<TlsConnector> = None;

Dependencies

~3–14MB
~191K SLoC