pub struct PathModeMemory {
pub paths: HashMap<String, PathModeStats>,
/* private fields */
}Fields§
§paths: HashMap<String, PathModeStats>Implementations§
Source§impl PathModeMemory
impl PathModeMemory
pub fn record_bounce(&mut self, norm_path: &str, now: u64)
Sourcepub fn record_read_if_tracked(&mut self, norm_path: &str)
pub fn record_read_if_tracked(&mut self, norm_path: &str)
Count a read only for paths already being tracked (i.e. that bounced before). Tracking every read of every file would bloat the store for zero signal.
Sourcepub fn should_force_full(&self, norm_path: &str) -> bool
pub fn should_force_full(&self, norm_path: &str) -> bool
A path is force-full when it bounced at least twice and bounces make up the majority of its observed reads — compressing it keeps backfiring.
pub fn save(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for PathModeMemory
impl Clone for PathModeMemory
Source§fn clone(&self) -> PathModeMemory
fn clone(&self) -> PathModeMemory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathModeMemory
impl Debug for PathModeMemory
Source§impl Default for PathModeMemory
impl Default for PathModeMemory
Source§fn default() -> PathModeMemory
fn default() -> PathModeMemory
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PathModeMemory
impl<'de> Deserialize<'de> for PathModeMemory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PathModeMemory
impl RefUnwindSafe for PathModeMemory
impl Send for PathModeMemory
impl Sync for PathModeMemory
impl Unpin for PathModeMemory
impl UnsafeUnpin for PathModeMemory
impl UnwindSafe for PathModeMemory
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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