pub struct ScoreModelProvider { /* private fields */ }Expand description
ScoreModel を使った Provider 実装
Model が事前計算したスコアを返すだけ。計算ロジックを持たない。
Implementations§
Source§impl ScoreModelProvider
impl ScoreModelProvider
Sourcepub fn new(model: ScoreModel) -> Self
pub fn new(model: ScoreModel) -> Self
Model から Provider を作成
Sourcepub fn from_stats(stats: LearnStats) -> Self
pub fn from_stats(stats: LearnStats) -> Self
LearnStats から Provider を作成(Model を自動構築)
Sourcepub fn inner(&self) -> &ScoreModel
pub fn inner(&self) -> &ScoreModel
Model を取得
Sourcepub fn update_model(&mut self, model: ScoreModel)
pub fn update_model(&mut self, model: ScoreModel)
Model を更新
Trait Implementations§
Source§impl LearnedProvider for ScoreModelProvider
impl LearnedProvider for ScoreModelProvider
Source§fn query(&self, q: LearningQuery<'_>) -> LearningResult
fn query(&self, q: LearningQuery<'_>) -> LearningResult
クエリを実行してボーナス/スコアを取得
Source§fn stats(&self) -> Option<&LearnStats>
fn stats(&self) -> Option<&LearnStats>
内部の LearnStats を取得(永続化用、実装がある場合のみ)
Source§fn model(&self) -> Option<&ScoreModel>
fn model(&self) -> Option<&ScoreModel>
内部の ScoreModel を取得(実装がある場合のみ)
Auto Trait Implementations§
impl Freeze for ScoreModelProvider
impl RefUnwindSafe for ScoreModelProvider
impl Send for ScoreModelProvider
impl Sync for ScoreModelProvider
impl Unpin for ScoreModelProvider
impl UnwindSafe for ScoreModelProvider
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