MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / open_cert_file

Function open_cert_file

1b_sockets/rust/tlsecho/src/bin/server.rs:7–14  ·  view source on GitHub ↗
(file: &str, method: F)

Source from the content-addressed store, hash-verified

5use std::thread;
6
7fn open_cert_file<F, T>(file: &str, method: F) -> Vec<T>
8where
9 F: Fn(&mut dyn BufRead) -> Result<Vec<T>, ()>,
10{
11 let certfile = fs::File::open(file).unwrap();
12 let mut reader = BufReader::new(certfile);
13 method(&mut reader).unwrap()
14}
15
16fn main() {
17 let mut config = rustls::ServerConfig::new(rustls::NoClientAuth::new());

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected