#tls #stub #api

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

#30 in #stub

Download history 2893/week @ 2025-11-06 2634/week @ 2025-11-13 2803/week @ 2025-11-20 2261/week @ 2025-11-27 2247/week @ 2025-12-04 2031/week @ 2025-12-11 1579/week @ 2025-12-18 1164/week @ 2025-12-25 1434/week @ 2026-01-01 1154/week @ 2026-01-08 1550/week @ 2026-01-15 2079/week @ 2026-01-22 2502/week @ 2026-01-29 1859/week @ 2026-02-05 6940/week @ 2026-02-12 33466/week @ 2026-02-19

45,592 downloads per month
Used in 21 crates (6 directly)

MIT/Apache

76KB
1.5K SLoC

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;

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);

Dependencies

~2–17MB
~197K SLoC