pub struct ConnectionInfoBuilder { /* private fields */ }Expand description
Fluent builder for ConnectionInfo.
Provides a separate builder type for constructing ConnectionInfo using
snake_case setter methods (version(), cipher_suite(), etc.) rather than
the with_* methods on ConnectionInfo itself.
§Example
use oxitls_core::{CipherSuite, ConnectionInfoBuilder, TlsVersion};
let info = ConnectionInfoBuilder::new()
.version(TlsVersion::Tls13)
.cipher_suite(CipherSuite::Tls13Aes256GcmSha384)
.alpn_protocol(b"h2".to_vec())
.sni("example.com".to_string())
.build();
assert_eq!(info.version, Some(TlsVersion::Tls13));Implementations§
Source§impl ConnectionInfoBuilder
impl ConnectionInfoBuilder
Sourcepub fn version(self, version: TlsVersion) -> Self
pub fn version(self, version: TlsVersion) -> Self
Set the negotiated TLS version.
Sourcepub fn cipher_suite(self, suite: CipherSuite) -> Self
pub fn cipher_suite(self, suite: CipherSuite) -> Self
Set the negotiated cipher suite.
Sourcepub fn alpn_protocol(self, proto: Vec<u8>) -> Self
pub fn alpn_protocol(self, proto: Vec<u8>) -> Self
Set the negotiated ALPN protocol bytes.
Sourcepub fn peer_certificates(self, certs: Vec<Vec<u8>>) -> Self
pub fn peer_certificates(self, certs: Vec<Vec<u8>>) -> Self
Set the peer certificate chain (DER-encoded, leaf first).
Sourcepub fn build(self) -> ConnectionInfo
pub fn build(self) -> ConnectionInfo
Consume the builder and produce a ConnectionInfo.
Trait Implementations§
Source§impl Debug for ConnectionInfoBuilder
impl Debug for ConnectionInfoBuilder
Source§impl Default for ConnectionInfoBuilder
impl Default for ConnectionInfoBuilder
Source§fn default() -> ConnectionInfoBuilder
fn default() -> ConnectionInfoBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConnectionInfoBuilder
impl RefUnwindSafe for ConnectionInfoBuilder
impl Send for ConnectionInfoBuilder
impl Sync for ConnectionInfoBuilder
impl Unpin for ConnectionInfoBuilder
impl UnsafeUnpin for ConnectionInfoBuilder
impl UnwindSafe for ConnectionInfoBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more