pub struct ContentCacheBudget {
pub max_files: usize,
pub max_bytes: u64,
pub max_file_size: u64,
pub cached_count: AtomicUsize,
pub cached_bytes: AtomicU64,
}Fields§
§max_files: usize§max_bytes: u64§max_file_size: u64§cached_count: AtomicUsize§cached_bytes: AtomicU64Implementations§
Source§impl ContentCacheBudget
impl ContentCacheBudget
pub fn unlimited() -> Self
pub fn zero() -> Self
pub fn new_for_repo(file_count: usize) -> Self
Sourcepub fn from_overrides(
max_files: usize,
max_bytes: u64,
max_file_size: u64,
) -> Option<Self>
pub fn from_overrides( max_files: usize, max_bytes: u64, max_file_size: u64, ) -> Option<Self>
Build a budget from caller-supplied overrides.
Each argument is a cap; 0 means “use the library default for that
cap” (inherits from Self::default, which is new_for_repo(30_000)).
Returns None when every cap is 0, signalling to the picker that it
should auto-size the budget from the final scanned file count rather
than applying an explicit override.
pub fn reset(&self)
Trait Implementations§
Source§impl Debug for ContentCacheBudget
impl Debug for ContentCacheBudget
Auto Trait Implementations§
impl !Freeze for ContentCacheBudget
impl RefUnwindSafe for ContentCacheBudget
impl Send for ContentCacheBudget
impl Sync for ContentCacheBudget
impl Unpin for ContentCacheBudget
impl UnsafeUnpin for ContentCacheBudget
impl UnwindSafe for ContentCacheBudget
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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