pub struct RecommendationContext {
pub preferences: HashMap<String, f64>,
pub history: Vec<String>,
pub ratings: HashMap<String, f64>,
pub interests: Vec<String>,
}Expand description
Context for generating recommendations.
Fields§
§preferences: HashMap<String, f64>User preferences
history: Vec<String>Previously viewed schemas
ratings: HashMap<String, f64>Explicit user ratings
interests: Vec<String>Tags or categories of interest
Implementations§
Source§impl RecommendationContext
impl RecommendationContext
pub fn new() -> Self
pub fn with_preference(self, key: impl Into<String>, value: f64) -> Self
pub fn with_history(self, schema_id: impl Into<String>) -> Self
pub fn with_rating(self, schema_id: impl Into<String>, rating: f64) -> Self
pub fn with_interest(self, tag: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for RecommendationContext
impl Clone for RecommendationContext
Source§fn clone(&self) -> RecommendationContext
fn clone(&self) -> RecommendationContext
Returns a duplicate of the value. Read more
1.0.0 · 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 RecommendationContext
impl Debug for RecommendationContext
Source§impl Default for RecommendationContext
impl Default for RecommendationContext
Source§fn default() -> RecommendationContext
fn default() -> RecommendationContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RecommendationContext
impl RefUnwindSafe for RecommendationContext
impl Send for RecommendationContext
impl Sync for RecommendationContext
impl Unpin for RecommendationContext
impl UnwindSafe for RecommendationContext
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