pub struct Limits {
pub max_file_bytes: u64,
pub parse_timeout: Duration,
pub max_subprocess_bytes: Option<u64>,
pub max_candidates: usize,
pub posting_cap: usize,
pub max_component: usize,
pub verification_budget: usize,
pub max_alignment_cells: usize,
pub helper_timeout: Duration,
pub execution: ExecutionPolicy,
}Expand description
The ceilings a run works under.
Separate from the execution policy because they answer a different question: the policy says what may run, and these say how much a run may spend on input that turns out to be hostile rather than merely large.
Fields§
§max_file_bytes: u64Largest file read.
parse_timeout: DurationLongest a single file may be parsed for.
max_subprocess_bytes: Option<u64>Largest amount of memory a subprocess may use, where the platform can say so.
max_candidates: usizeLargest number of candidate pairs generated before a run gives up on generating more and says so.
posting_cap: usizeLongest posting list or fragment class admitted to candidate pairing.
This bounds the fan-out before the pair budget applies. Keeping it separate makes the untrusted profile cap both the number of lists and the work one high-frequency list can create.
max_component: usizeLargest related component refined as one group.
Complete-linkage refinement can repeatedly compare a component, so a distinct ceiling keeps an adversarially large related set bounded even after candidate generation has stopped.
verification_budget: usizeLargest distinct Structural pairs admitted to precise verification.
max_alignment_cells: usizeLargest dynamic-programming cell count for one Structural alignment.
helper_timeout: DurationLongest a compiler helper may spend answering for one source unit.
execution: ExecutionPolicyWhat may run.
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn untrusted() -> Self
pub fn untrusted() -> Self
The profile for a repository nobody vouches for.
Every ceiling lower than the default and nothing permitted to run. It is a starting point rather than a sandbox: it bounds what a hostile input can cost, and it cannot bound what a program does once something has agreed to run it, which is why it grants no execution at all.
Sourcepub fn is_at_most(&self, other: &Self) -> bool
pub fn is_at_most(&self, other: &Self) -> bool
Whether every ceiling here is at or below other’s.
A profile that claims to be stricter has to be stricter in every dimension; one that tightened a timeout while raising a size ceiling would be a different trade, not a stricter one.
Trait Implementations§
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.