pub struct SafetyNetBudget {
pub max_scan_time_us: u64,
pub max_scan_candidates: u64,
pub max_distance_ops: u64,
}Expand description
Budget caps for the brute-force safety net.
All three are enforced simultaneously. The scan stops at whichever hits
first. These are runtime limits, not caller-adjustable above the defaults
(unless QualityPreference::PreferQuality, which extends to 4x).
Fields§
§max_scan_time_us: u64Maximum wall-clock time for the safety net scan (microseconds).
max_scan_candidates: u64Maximum number of candidate vectors to scan.
max_distance_ops: u64Maximum number of distance evaluations.
Implementations§
Source§impl SafetyNetBudget
impl SafetyNetBudget
Sourcepub const fn extended_4x(&self) -> Self
pub const fn extended_4x(&self) -> Self
Extend all budgets by 4x for PreferQuality mode. Uses saturating arithmetic to prevent overflow.
Sourcepub const fn is_disabled(&self) -> bool
pub const fn is_disabled(&self) -> bool
Check if all budgets are zero (disabled).
Trait Implementations§
Source§impl Clone for SafetyNetBudget
impl Clone for SafetyNetBudget
Source§fn clone(&self) -> SafetyNetBudget
fn clone(&self) -> SafetyNetBudget
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 SafetyNetBudget
impl Debug for SafetyNetBudget
Source§impl Default for SafetyNetBudget
impl Default for SafetyNetBudget
Source§impl PartialEq for SafetyNetBudget
impl PartialEq for SafetyNetBudget
impl Copy for SafetyNetBudget
impl Eq for SafetyNetBudget
impl StructuralPartialEq for SafetyNetBudget
Auto Trait Implementations§
impl Freeze for SafetyNetBudget
impl RefUnwindSafe for SafetyNetBudget
impl Send for SafetyNetBudget
impl Sync for SafetyNetBudget
impl Unpin for SafetyNetBudget
impl UnsafeUnpin for SafetyNetBudget
impl UnwindSafe for SafetyNetBudget
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