#tls

tls-api-stub

TLS API implementation that returns error on any operation

20 releases

✓ Uses Rust 2018 edition

0.4.0 May 17, 2020
0.3.2 Jan 3, 2020
0.2.1 Jan 1, 2020
0.2.0 May 26, 2019
0.1.8 Jun 17, 2017

#13 in #tls

Download history 426/week @ 2020-02-08 449/week @ 2020-02-15 545/week @ 2020-02-22 330/week @ 2020-02-29 527/week @ 2020-03-07 405/week @ 2020-03-14 508/week @ 2020-03-21 521/week @ 2020-03-28 668/week @ 2020-04-04 608/week @ 2020-04-11 693/week @ 2020-04-18 751/week @ 2020-04-25 617/week @ 2020-05-02 942/week @ 2020-05-09 1225/week @ 2020-05-16 922/week @ 2020-05-23

2,560 downloads per month
Used in 17 crates (4 directly)

MIT/Apache

17KB
415 lines

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 you want to use this function without TLS, you can call it with stub connector:

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

~1.5MB
~29K SLoC