#tls #stub #operation

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

#50 in #stub

Download history 8712/week @ 2026-03-03 42622/week @ 2026-03-10 30882/week @ 2026-03-17 36970/week @ 2026-03-24 49855/week @ 2026-03-31 49056/week @ 2026-04-07 46303/week @ 2026-04-14 49828/week @ 2026-04-21 33564/week @ 2026-04-28 39092/week @ 2026-05-05 45654/week @ 2026-05-12 56136/week @ 2026-05-19 57033/week @ 2026-05-26 31479/week @ 2026-06-02

197,361 downloads per month
Used in 16 crates (5 directly)

MIT/Apache

9KB
168 lines

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–9MB
~187K SLoC