#tls-api #tls #stub #tls-connector #api-error #operations #return

tls-api-stub

TLS API implementation that returns error on any operation

25 releases (8 breaking)

0.9.0 Apr 28, 2022
0.7.0 Oct 26, 2021
0.5.0 Feb 21, 2021
0.4.0 May 17, 2020
0.1.8 Jun 17, 2017

#7 in #tls-api

Download history 5674/week @ 2024-07-21 7691/week @ 2024-07-28 6443/week @ 2024-08-04 6754/week @ 2024-08-11 6295/week @ 2024-08-18 6481/week @ 2024-08-25 6196/week @ 2024-09-01 7133/week @ 2024-09-08 6158/week @ 2024-09-15 4723/week @ 2024-09-22 6804/week @ 2024-09-29 5804/week @ 2024-10-06 6239/week @ 2024-10-13 5396/week @ 2024-10-20 5337/week @ 2024-10-27 5057/week @ 2024-11-03

22,357 downloads per month
Used in 23 crates (6 directly)

MIT/Apache

105KB
2K SLoC

GitHub Workflow Status License crates.io

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::TlsConnector;

let no_connector: Option<TlsConnector> = None;

Dependencies

~11–23MB
~442K SLoC