pub trait PlanningId {
type Id: Eq + Hash + Clone + Send + Sync + 'static;
// Required method
fn planning_id(&self) -> Self::Id;
}Expand description
Trait for unique identification of entities and facts.
Used for looking up working copies during solving and rebasing moves.
§Example
use solverforge_core::PlanningId;
#[derive(Clone)]
struct Task {
id: i64,
name: String,
}
impl PlanningId for Task {
type Id = i64;
fn planning_id(&self) -> i64 { self.id }
}The ID type must be Eq + Hash + Clone.
Required Associated Types§
Required Methods§
fn planning_id(&self) -> Self::Id
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".