#tls #stub #operation #api #object #error

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

#1263 in Network programming

Download history 4213/week @ 2025-03-03 5822/week @ 2025-03-10 6405/week @ 2025-03-17 5095/week @ 2025-03-24 7850/week @ 2025-03-31 14155/week @ 2025-04-07 11779/week @ 2025-04-14 6844/week @ 2025-04-21 5253/week @ 2025-04-28 7460/week @ 2025-05-05 4266/week @ 2025-05-12 4191/week @ 2025-05-19 3463/week @ 2025-05-26 3421/week @ 2025-06-02 3823/week @ 2025-06-09 3744/week @ 2025-06-16

14,686 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–14MB
~198K SLoC