pub struct RustlsTransportLimits { /* private fields */ }Expand description
Stable per-connection charges for rustls-owned variable memory.
Implementations§
Source§impl RustlsTransportLimits
impl RustlsTransportLimits
Sourcepub fn new(
application_write_buffer_bytes: NonZeroUsize,
max_tls_egress_bytes: NonZeroUsize,
max_plaintext_bytes: NonZeroUsize,
pressure: TransportPressure,
) -> Result<Self, RustlsTransportLimitsError>
pub fn new( application_write_buffer_bytes: NonZeroUsize, max_tls_egress_bytes: NonZeroUsize, max_plaintext_bytes: NonZeroUsize, pressure: TransportPressure, ) -> Result<Self, RustlsTransportLimitsError>
Creates mechanically enforced logical-buffer bounds and one stable memory charge.
The application-write bound is applied through rustls’s buffer limit. The
egress and readable-plaintext bounds are checked after every rustls state
transition. pressure is the caller-audited conservative charge for rustls’s
private allocation capacities and per-connection cryptographic state; rustls
does not expose those capacities for mechanical measurement. The outbound and
plaintext charges must cover their logical maxima, while inbound and protocol
charges must cover the exact rustls version, provider, and client configuration.
Sourcepub const fn application_write_buffer_bytes(self) -> NonZeroUsize
pub const fn application_write_buffer_bytes(self) -> NonZeroUsize
Returns the hard rustls application-write buffer limit.
Sourcepub const fn max_tls_egress_bytes(self) -> NonZeroUsize
pub const fn max_tls_egress_bytes(self) -> NonZeroUsize
Returns the maximum observable encrypted output retained by rustls.
Sourcepub const fn max_plaintext_bytes(self) -> NonZeroUsize
pub const fn max_plaintext_bytes(self) -> NonZeroUsize
Returns the maximum observable application plaintext retained by rustls.
Sourcepub const fn pressure(self) -> TransportPressure
pub const fn pressure(self) -> TransportPressure
Returns the stable caller-audited rustls retained-memory charge.
Sourcepub const fn transport_limits(self) -> TransportLimits
pub const fn transport_limits(self) -> TransportLimits
Returns the exact aggregate charge advertised to Bornera.