Skip to main content

Limits

Struct Limits 

Source
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: u64

Largest file read.

§parse_timeout: Duration

Longest 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: usize

Largest number of candidate pairs generated before a run gives up on generating more and says so.

§posting_cap: usize

Longest 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: usize

Largest 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: usize

Largest distinct Structural pairs admitted to precise verification.

§max_alignment_cells: usize

Largest dynamic-programming cell count for one Structural alignment.

§helper_timeout: Duration

Longest a compiler helper may spend answering for one source unit.

§execution: ExecutionPolicy

What may run.

Implementations§

Source§

impl Limits

Source

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.

Source

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§

Source§

impl Clone for Limits

Source§

fn clone(&self) -> Limits

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Limits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Limits

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Limits

Source§

impl PartialEq for Limits

Source§

fn eq(&self, other: &Limits) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Limits

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.