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

#690 in Testing

Download history 3553/week @ 2024-01-05 3231/week @ 2024-01-12 1955/week @ 2024-01-19 1830/week @ 2024-01-26 2711/week @ 2024-02-02 2688/week @ 2024-02-09 5241/week @ 2024-02-16 4056/week @ 2024-02-23 2638/week @ 2024-03-01 2093/week @ 2024-03-08 3402/week @ 2024-03-15 2582/week @ 2024-03-22 4386/week @ 2024-03-29 3048/week @ 2024-04-05 2086/week @ 2024-04-12 2261/week @ 2024-04-19

12,055 downloads per month
Used in 22 crates (5 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–24MB
~442K SLoC