pub struct PlacementResourceLimits {
pub max_cpu_time_ms: u64,
pub max_memory_bytes: usize,
pub max_frame_payload_bytes: usize,
pub max_stream_frames: usize,
pub max_duration_ms: u64,
pub max_rate_hz: u32,
pub max_inflight_work: usize,
}Expand description
Resource bounds enforced on a server placement before and during execution.
Combines compute bounds (CPU time, memory, inflight work) with the
frame-shaping bounds shared with StreamRemoteLimits. A placement that
would exceed any bound is refused rather than run unbounded; see
PlacementResourceLimits::validate. The Default impl applies
conservative defaults.
Fields§
§max_cpu_time_ms: u64Maximum wall-clock CPU time, in milliseconds, allowed for the node.
max_memory_bytes: usizeMaximum accounted payload memory, in bytes, across emitted frames.
max_frame_payload_bytes: usizeMaximum encoded payload size, in bytes, allowed for a single frame.
max_stream_frames: usizeMaximum number of data frames emitted for one placement.
max_duration_ms: u64Maximum stream duration, in milliseconds, before truncation.
max_rate_hz: u32Maximum stream rate, in hertz, used to derive the effective frame limit.
max_inflight_work: usizeMaximum number of frames allowed in flight at once.
Implementations§
Source§impl PlacementResourceLimits
impl PlacementResourceLimits
Sourcepub fn validate(self) -> Result<()>
pub fn validate(self) -> Result<()>
Validates that every bound is positive and frame-consistent.
Returns an error when CPU time, memory, stream-size, or inflight-work is
zero, or when the derived PlacementResourceLimits::remote_limits are
themselves invalid.
Sourcepub fn remote_limits(self) -> StreamRemoteLimits
pub fn remote_limits(self) -> StreamRemoteLimits
Projects the frame-shaping subset of these limits onto a
StreamRemoteLimits, mapping inflight-work to the inflight-frame bound.
Sourcepub fn effective_stream_frame_limit(self) -> usize
pub fn effective_stream_frame_limit(self) -> usize
Returns the effective per-stream frame limit after duration and rate bounds are folded into the configured stream-size limit.
Trait Implementations§
Source§impl Clone for PlacementResourceLimits
impl Clone for PlacementResourceLimits
Source§fn clone(&self) -> PlacementResourceLimits
fn clone(&self) -> PlacementResourceLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PlacementResourceLimits
Source§impl Debug for PlacementResourceLimits
impl Debug for PlacementResourceLimits
Source§impl Default for PlacementResourceLimits
impl Default for PlacementResourceLimits
impl Eq for PlacementResourceLimits
Source§impl PartialEq for PlacementResourceLimits
impl PartialEq for PlacementResourceLimits
Source§fn eq(&self, other: &PlacementResourceLimits) -> bool
fn eq(&self, other: &PlacementResourceLimits) -> bool
self and other values to be equal, and is used by ==.