Skip to main content

RustlsServerSession

Struct RustlsServerSession 

Source
pub struct RustlsServerSession { /* private fields */ }
Expand description

One bounded rustls server connection without a socket, clock, task, or runtime.

Implementations§

Source§

impl RustlsServerSession

Source

pub fn ingest_tls(&mut self, ciphertext: &[u8]) -> Result<usize, TransportError>

Copies caller-owned ciphertext into rustls and returns its exact consumed count.

Source

pub fn read_plaintext( &mut self, output: &mut [u8], ) -> Result<usize, TransportError>

Reads authenticated plaintext and returns the exact copied count.

Source

pub fn write_plaintext( &mut self, plaintext: &[u8], ) -> Result<usize, TransportError>

Irreversibly accepts bounded response plaintext and returns its exact count.

Source

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.

Source

pub fn finish_input(&mut self) -> Result<(), TransportError>

Records raw input EOF, deferring truncation until authenticated plaintext drains.

Source

pub fn send_close_notify(&mut self) -> Result<(), TransportError>

Starts graceful local TLS shutdown; repeated calls are idempotent.

Source§

impl RustlsServerSession

Source

pub fn new( config: &RustlsServerConfig, supplied: TransportLimits, ) -> Result<Self, RustlsServerSessionError>

Constructs a session only when its stable charge fits the supplied ceiling.

Source

pub fn status(&self) -> RustlsServerStatus

Returns the exact externally actionable session state.

Source

pub const fn pressure(&self) -> TransportPressure

Returns the exact stable charge reserved for this session.

Source

pub const fn limits(&self) -> RustlsTransportLimits

Returns the logical and accounting limits enforced by this session.

Source

pub fn alpn_protocol(&self) -> Option<&[u8]>

Returns the negotiated ALPN identifier without copying it.

Source

pub fn server_name(&self) -> Option<&str>

Returns the offered ClientHello SNI value without copying it.

Trait Implementations§

Source§

impl Debug for RustlsServerSession

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.