Skip to main content

LoadOptions

Struct LoadOptions 

Source
#[non_exhaustive]
pub struct LoadOptions { pub max_file_bytes: u64, pub max_file_tokens: usize, pub max_total_bytes: usize, pub max_item_bytes: usize, pub max_fact_bytes: usize, pub max_glob_bytes: usize, pub max_work: usize, pub max_query_work: usize, }
Expand description

Limits a caller sets for one load.

The token budget, the byte budgets and the work budgets of the load and of each query after it default to the limits of Budget::FileTokens, Budget::TotalBytes, Budget::ItemBytes, Budget::FactBytes, Budget::GlobBytes and Budget::Work. A load that passes one is refused with LoadErrorKind::Budget, naming the budget, the limit that applied and the file.

The options are Clone and not Copy, so adding an option that is not Copy, such as a per-file hook, is not a breaking change.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§max_file_bytes: u64

The most bytes one file may hold. A larger file is refused with TreeError::TooLarge. Defaults to DEFAULT_MAX_FILE_BYTES.

§max_file_tokens: usize

The most tokens one file may hold, counted by the pre-scan before the file is parsed. This bounds token structure, not the complete native parser heap or work. PARSE_BYTES_PER_TOKEN records one empirical statement-shape measurement; source-byte payloads and transient native storage require separate accounting.

§max_total_bytes: usize

The most bytes one load may read, source files and manifests together. Defaults to the limit of Budget::TotalBytes.

§max_item_bytes: usize

The cumulative bytes of index records, entries built for each module path, native load traversal spills and immutable derived glob facts, including their shared allocation header. Defaults to the limit of Budget::ItemBytes.

§max_fact_bytes: usize

The most bytes the facts of the files of one load may hold. Defaults to the limit of Budget::FactBytes.

§max_glob_bytes: usize

The most bytes import settling may hold at once: glob scope tables, retained reads, queues, subscriptions, graph scratch and impl self-type and trait-path traversal scratch, plus derived glob-fact construction. Also bounds transient selected-route determinacy proofs of each query after the load, counted from zero and released before it returns. Defaults to the limit of Budget::GlobBytes.

§max_work: usize

The most import-settling and impl self-type and trait-path traversal steps one load may make, including retained path segments and bytes, counted as they are made and never given back (see Budget::Work). Defaults to the limit of Budget::Work.

§max_query_work: usize

The most lookup and selected-route proof steps one query after the load may make: a call of Workspace::resolve, its variants or Workspace::exported_items_with, each counted from zero. A query that passes it fails with ResolveError::Budget or ExportError::Budget, naming Budget::Work and this limit. Defaults to the limit of Budget::Work.

Trait Implementations§

Source§

impl Clone for LoadOptions

Source§

fn clone(&self) -> Self

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 LoadOptions

Source§

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

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

impl Default for LoadOptions

Source§

fn default() -> Self

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

impl Eq for LoadOptions

Source§

impl PartialEq for LoadOptions

Source§

fn eq(&self, other: &Self) -> 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 LoadOptions

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

Whether this borrowed key equals the stored key.
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> EvidenceLease for T
where T: Debug + Send + Sync,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.