pub struct SafetyConstraints {
pub max_timeout_ms: u64,
pub max_memory_mb: u64,
pub max_cpu_percent: u8,
pub max_file_handles: u32,
}Expand description
Safety constraints for high-risk operations
Fields§
§max_timeout_ms: u64Maximum execution timeout for high-risk operations (milliseconds)
max_memory_mb: u64Maximum memory usage in MB
max_cpu_percent: u8Maximum CPU percentage (0-100)
max_file_handles: u32Maximum file handles
Implementations§
Source§impl SafetyConstraints
impl SafetyConstraints
Sourcepub fn with_timeout(timeout_ms: u64) -> Self
pub fn with_timeout(timeout_ms: u64) -> Self
Create safety constraints with custom timeout
Sourcepub fn apply_to_step(
&self,
step: &WorkflowStep,
_risk_score: u8,
) -> Vec<SafetyViolation>
pub fn apply_to_step( &self, step: &WorkflowStep, _risk_score: u8, ) -> Vec<SafetyViolation>
Apply safety constraints to a high-risk step
Sourcepub fn enforce_timeout(&self, step: &WorkflowStep) -> Duration
pub fn enforce_timeout(&self, step: &WorkflowStep) -> Duration
Enforce timeout on a high-risk operation
Sourcepub fn has_rollback_capability(&self, step: &WorkflowStep) -> bool
pub fn has_rollback_capability(&self, step: &WorkflowStep) -> bool
Check if rollback capability is maintained
Trait Implementations§
Source§impl Clone for SafetyConstraints
impl Clone for SafetyConstraints
Source§fn clone(&self) -> SafetyConstraints
fn clone(&self) -> SafetyConstraints
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 moreSource§impl Debug for SafetyConstraints
impl Debug for SafetyConstraints
Auto Trait Implementations§
impl Freeze for SafetyConstraints
impl RefUnwindSafe for SafetyConstraints
impl Send for SafetyConstraints
impl Sync for SafetyConstraints
impl Unpin for SafetyConstraints
impl UnwindSafe for SafetyConstraints
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