pub struct FrameGuardrails { /* private fields */ }Expand description
Unified frame guardrails combining memory budget and queue depth limits.
Call check_frame once per frame with current resource
usage. The returned GuardrailVerdict tells you what (if anything) to do.
Implementations§
Source§impl FrameGuardrails
impl FrameGuardrails
Sourcepub fn new(config: GuardrailsConfig) -> Self
pub fn new(config: GuardrailsConfig) -> Self
Create a new unified guardrails instance.
Sourcepub fn check_frame(
&mut self,
memory_bytes: usize,
queue_depth: u32,
) -> GuardrailVerdict
pub fn check_frame( &mut self, memory_bytes: usize, queue_depth: u32, ) -> GuardrailVerdict
Check all guardrails for the current frame.
memory_bytes: total rendering memory in use (buffer + pools).
queue_depth: number of pending frames waiting to be rendered.
Sourcepub fn memory(&self) -> &MemoryBudget
pub fn memory(&self) -> &MemoryBudget
Access the memory budget subsystem.
Sourcepub fn queue(&self) -> &QueueGuardrails
pub fn queue(&self) -> &QueueGuardrails
Access the queue guardrails subsystem.
Sourcepub fn frames_checked(&self) -> u64
pub fn frames_checked(&self) -> u64
Total frames checked.
Sourcepub fn frames_with_alerts(&self) -> u64
pub fn frames_with_alerts(&self) -> u64
Total frames where at least one alert fired.
Sourcepub fn alert_rate(&self) -> f64
pub fn alert_rate(&self) -> f64
Fraction of frames that triggered alerts (0.0–1.0).
Sourcepub fn snapshot(&self) -> GuardrailSnapshot
pub fn snapshot(&self) -> GuardrailSnapshot
Capture a diagnostic snapshot.
Trait Implementations§
Source§impl Clone for FrameGuardrails
impl Clone for FrameGuardrails
Source§fn clone(&self) -> FrameGuardrails
fn clone(&self) -> FrameGuardrails
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FrameGuardrails
impl RefUnwindSafe for FrameGuardrails
impl Send for FrameGuardrails
impl Sync for FrameGuardrails
impl Unpin for FrameGuardrails
impl UnwindSafe for FrameGuardrails
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more