pub struct IncludeBudget {
pub max_files: usize,
pub max_depth: usize,
}Expand description
How much of a project one walk may index.
Two limits rather than one, because they bound different failures: a file count bounds the total work, and a depth bounds the recursion along a chain that is long but narrow (a generated include ladder, a cycle that only its guards break). Neither is a policy about what is worth analysing — that is the caller’s — they are what keeps a pathological project from making one call take the session.
Fields§
§max_files: usizeHow many files one call may open, the entry included.
max_depth: usizeHow far the include chain is followed from the entry, which is at depth 0.
Trait Implementations§
Source§impl Clone for IncludeBudget
impl Clone for IncludeBudget
impl Copy for IncludeBudget
Source§impl Debug for IncludeBudget
impl Debug for IncludeBudget
Source§impl Default for IncludeBudget
impl Default for IncludeBudget
Source§fn default() -> Self
fn default() -> Self
Roomy enough that a real closure is never truncated, bounded enough to be a limit.
The measured worst case is <bits/stdc++.h> at 359 files and a normal translation unit’s closure at 185
so 4096 is more than ten times the largest case anyone has measured — while a
project whose include graph is that large is one a caller wants to hear about anyway, which is what
IncludeIndex::not_indexed is for.
impl Eq for IncludeBudget
Source§impl PartialEq for IncludeBudget
impl PartialEq for IncludeBudget
impl StructuralPartialEq for IncludeBudget
Auto Trait Implementations§
impl Forget for IncludeBudget
impl Freeze for IncludeBudget
impl Move for IncludeBudget
impl RefUnwindSafe for IncludeBudget
impl Send for IncludeBudget
impl Sync for IncludeBudget
impl Unpin for IncludeBudget
impl UnsafeUnpin for IncludeBudget
impl UnwindSafe for IncludeBudget
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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