1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::*;
use std::sync::Arc;
pub struct RuinAndRecreate {
ruin: Arc<dyn Ruin + Send + Sync>,
recreate: Arc<dyn Recreate + Send + Sync>,
}
impl RuinAndRecreate {
pub fn new(ruin: Arc<dyn Ruin + Send + Sync>, recreate: Arc<dyn Recreate + Send + Sync>) -> Self {
Self { ruin, recreate }
}
}
impl Mutation for RuinAndRecreate {
fn mutate(&self, refinement_ctx: &RefinementContext, insertion_ctx: &InsertionContext) -> InsertionContext {
self.recreate.run(refinement_ctx, self.ruin.run(refinement_ctx, insertion_ctx.deep_copy()))
}
}