pub struct RustlsServerSession { /* private fields */ }Expand description
One bounded rustls server connection without a socket, clock, task, or runtime.
Implementations§
Source§impl RustlsServerSession
impl RustlsServerSession
Sourcepub fn ingest_tls(&mut self, ciphertext: &[u8]) -> Result<usize, TransportError>
pub fn ingest_tls(&mut self, ciphertext: &[u8]) -> Result<usize, TransportError>
Copies caller-owned ciphertext into rustls and returns its exact consumed count.
Sourcepub fn read_plaintext(
&mut self,
output: &mut [u8],
) -> Result<usize, TransportError>
pub fn read_plaintext( &mut self, output: &mut [u8], ) -> Result<usize, TransportError>
Reads authenticated plaintext and returns the exact copied count.
Sourcepub fn write_plaintext(
&mut self,
plaintext: &[u8],
) -> Result<usize, TransportError>
pub fn write_plaintext( &mut self, plaintext: &[u8], ) -> Result<usize, TransportError>
Irreversibly accepts bounded response plaintext and returns its exact count.
Sourcepub fn drain_tls(&mut self, output: &mut [u8]) -> Result<usize, TransportError>
pub fn drain_tls(&mut self, output: &mut [u8]) -> Result<usize, TransportError>
Copies pending TLS records into a caller buffer and returns the exact produced count.
Sourcepub fn finish_input(&mut self) -> Result<(), TransportError>
pub fn finish_input(&mut self) -> Result<(), TransportError>
Records raw input EOF, deferring truncation until authenticated plaintext drains.
Sourcepub fn send_close_notify(&mut self) -> Result<(), TransportError>
pub fn send_close_notify(&mut self) -> Result<(), TransportError>
Starts graceful local TLS shutdown; repeated calls are idempotent.
Source§impl RustlsServerSession
impl RustlsServerSession
Sourcepub fn new(
config: &RustlsServerConfig,
supplied: TransportLimits,
) -> Result<Self, RustlsServerSessionError>
pub fn new( config: &RustlsServerConfig, supplied: TransportLimits, ) -> Result<Self, RustlsServerSessionError>
Constructs a session only when its stable charge fits the supplied ceiling.
Sourcepub fn status(&self) -> RustlsServerStatus
pub fn status(&self) -> RustlsServerStatus
Returns the exact externally actionable session state.
Sourcepub const fn pressure(&self) -> TransportPressure
pub const fn pressure(&self) -> TransportPressure
Returns the exact stable charge reserved for this session.
Sourcepub const fn limits(&self) -> RustlsTransportLimits
pub const fn limits(&self) -> RustlsTransportLimits
Returns the logical and accounting limits enforced by this session.
Sourcepub fn alpn_protocol(&self) -> Option<&[u8]>
pub fn alpn_protocol(&self) -> Option<&[u8]>
Returns the negotiated ALPN identifier without copying it.
Sourcepub fn server_name(&self) -> Option<&str>
pub fn server_name(&self) -> Option<&str>
Returns the offered ClientHello SNI value without copying it.