#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_file_bytes: u64The most bytes one file may hold. A larger file is refused with
TreeError::TooLarge. Defaults to
DEFAULT_MAX_FILE_BYTES.
max_file_tokens: usizeThe 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: usizeThe most bytes one load may read, source files and manifests together.
Defaults to the limit of Budget::TotalBytes.
max_item_bytes: usizeThe 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: usizeThe most bytes the facts of the files of one load may hold. Defaults to
the limit of Budget::FactBytes.
max_glob_bytes: usizeThe 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: usizeThe 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: usizeThe 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
impl Clone for LoadOptions
Source§impl Debug for LoadOptions
impl Debug for LoadOptions
Source§impl Default for LoadOptions
impl Default for LoadOptions
impl Eq for LoadOptions
Source§impl PartialEq for LoadOptions
impl PartialEq for LoadOptions
impl StructuralPartialEq for LoadOptions
Auto Trait Implementations§
impl Forget for LoadOptions
impl Freeze for LoadOptions
impl Move for LoadOptions
impl RefUnwindSafe for LoadOptions
impl Send for LoadOptions
impl Sync for LoadOptions
impl Unpin for LoadOptions
impl UnsafeUnpin for LoadOptions
impl UnwindSafe for LoadOptions
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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.impl<T> EvidenceLease for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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