pub trait Scoreable: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn score_proxy(&self) -> f32;
fn category(&self) -> &str;
fn metadata(&self) -> &HashMap<String, String>;
// Provided method
fn prerequisites(&self) -> &[String] { ... }
}Expand description
Trait that caller’s item type must implement.
The engine only needs three things from any item:
- a stable unique ID
- a normalised score proxy (0.0–1.0) used by built-in factors (difficulty in learning, price_ratio in ecommerce, remoteness in travel…)
- a category/topic string for coverage factor
All other domain data lives in metadata() — accessible to custom factors.
Required Methods§
fn id(&self) -> &str
Sourcefn score_proxy(&self) -> f32
fn score_proxy(&self) -> f32
Normalised difficulty/complexity proxy. Range [0.0, 1.0]. Caller defines what this means in their domain.
Provided Methods§
Sourcefn prerequisites(&self) -> &[String]
fn prerequisites(&self) -> &[String]
Prerequisite item IDs. Engine will not suggest this item
until all prereqs appear in the user’s resolved_set.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".