pub struct ThresholdLearner {
pub per_ext: HashMap<String, LearnedDelta>,
pub schema_version: u32,
}Fields§
§per_ext: HashMap<String, LearnedDelta>Keyed by lowercase extension without dot (e.g. “rs”).
schema_version: u32Implementations§
Source§impl ThresholdLearner
impl ThresholdLearner
Sourcepub fn merge_from(&mut self, other: &Self)
pub fn merge_from(&mut self, other: &Self)
Team-merge (#550): sample-weighted average of deltas, never a blind
overwrite. samples = max(...) (not the sum) and weighted-mean deltas
make re-importing the same bundle a no-op (idempotent roundtrip) and
prevent double counting. Clamps stay authoritative.
Sourcepub fn record(&mut self, ext: &str, signal: QualitySignal, now: u64)
pub fn record(&mut self, ext: &str, signal: QualitySignal, now: u64)
Apply one quality signal for ext at now (unix seconds).
Sourcepub fn delta_for(&mut self, ext: &str, now: u64) -> f64
pub fn delta_for(&mut self, ext: &str, now: u64) -> f64
Additive entropy-threshold delta for ext, or 0.0 before MIN_SAMPLES.
Sourcepub fn report_lines(&self) -> Vec<String>
pub fn report_lines(&self) -> Vec<String>
One line per learned extension, for ctx_metrics.
Trait Implementations§
Source§impl Clone for ThresholdLearner
impl Clone for ThresholdLearner
Source§fn clone(&self) -> ThresholdLearner
fn clone(&self) -> ThresholdLearner
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 ThresholdLearner
impl Debug for ThresholdLearner
Source§impl Default for ThresholdLearner
impl Default for ThresholdLearner
Source§fn default() -> ThresholdLearner
fn default() -> ThresholdLearner
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ThresholdLearner
impl<'de> Deserialize<'de> for ThresholdLearner
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 ThresholdLearner
impl RefUnwindSafe for ThresholdLearner
impl Send for ThresholdLearner
impl Sync for ThresholdLearner
impl Unpin for ThresholdLearner
impl UnsafeUnpin for ThresholdLearner
impl UnwindSafe for ThresholdLearner
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