pub struct StreamRemoteLimits {
pub max_frame_payload_bytes: usize,
pub max_stream_frames: usize,
pub max_inflight_frames: usize,
pub max_duration_ms: u64,
pub max_rate_hz: u32,
pub max_binary_payload_bytes: usize,
}Expand description
Quantitative bounds a stream must respect when it crosses a remote boundary.
These limits cap payload size, frame count, concurrency, lifetime, and rate so a remote peer cannot exhaust local resources.
Fields§
§max_frame_payload_bytes: usizeMaximum bytes carried in a single frame payload.
max_stream_frames: usizeMaximum number of frames a stream may carry.
max_inflight_frames: usizeMaximum number of frames in flight at once.
max_duration_ms: u64Maximum stream lifetime in milliseconds.
max_rate_hz: u32Maximum frame rate in hertz.
max_binary_payload_bytes: usizeMaximum bytes carried in a single binary payload.
Implementations§
Source§impl StreamRemoteLimits
impl StreamRemoteLimits
Sourcepub fn validate(self) -> Result<()>
pub fn validate(self) -> Result<()>
Checks that every positive-only limit is non-zero.
Returns an Error::Eval naming the first limit that is zero.
Sourcepub fn validate_profile(self, profile: &TransportProfile) -> Result<()>
pub fn validate_profile(self, profile: &TransportProfile) -> Result<()>
Validates these limits against a transport profile.
Beyond validate, this rejects a realtime profile that
lacks local preview transport and a remote profile that crosses a
boundary without bounded limits.
Sourcepub fn effective_frame_limit(self) -> usize
pub fn effective_frame_limit(self) -> usize
Returns the effective frame ceiling: the smaller of the configured frame cap and the frames implied by the duration and rate limits.
Trait Implementations§
Source§impl Clone for StreamRemoteLimits
impl Clone for StreamRemoteLimits
Source§fn clone(&self) -> StreamRemoteLimits
fn clone(&self) -> StreamRemoteLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more