🏗️ Elegant & Highly Performant Async Gemini Server Framework for the Modern Age
async framework gemini-protocol protocol gemini rust
at main 25 lines 493 B view raw
1use openssl::x509::X509; 2use url::Url; 3 4#[allow(clippy::module_name_repetitions)] 5#[derive(Clone)] 6pub struct ErrorContext { 7 pub peer_address: Option<std::net::SocketAddr>, 8 pub url: Url, 9 pub certificate: Option<X509>, 10} 11 12impl ErrorContext { 13 #[must_use] 14 pub fn new( 15 peer_address: std::io::Result<std::net::SocketAddr>, 16 url: Url, 17 certificate: Option<X509>, 18 ) -> Self { 19 Self { 20 peer_address: peer_address.ok(), 21 url, 22 certificate, 23 } 24 } 25}