Region: remove the Serialization requirement

This commit is contained in:
2022-08-12 00:56:28 -07:00
parent 090b1ca09a
commit d5fbb4e9b2
7 changed files with 30 additions and 111 deletions

View File

@@ -212,7 +212,7 @@ impl<S: AbstractSim> AbstractMeasurement<S> for Meta {
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
pub struct Volume {
name: String,
region: Box<dyn Region>,
@@ -241,7 +241,7 @@ impl<S: AbstractSim> AbstractMeasurement<S> for Volume {
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
pub struct Current {
name: String,
region: Box<dyn Region>,
@@ -471,7 +471,7 @@ impl<S: AbstractSim> AbstractMeasurement<S> for MagneticLoop {
}
/// mean M over a region
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
pub struct MagneticFlux {
name: String,
region: Box<dyn Region>,
@@ -508,7 +508,7 @@ impl<S: AbstractSim> AbstractMeasurement<S> for MagneticFlux {
}
/// mean B over a region
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
pub struct Magnetization {
name: String,
region: Box<dyn Region>,
@@ -604,7 +604,7 @@ impl<S: AbstractSim> AbstractMeasurement<S> for ElectricField {
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
pub struct Energy {
name: String,
region: Box<dyn Region>,
@@ -648,7 +648,7 @@ impl<S: AbstractSim> AbstractMeasurement<S> for Energy {
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
pub struct Power {
name: String,
region: Box<dyn Region>
@@ -741,7 +741,6 @@ pub mod test {
self.normal
}
}
#[typetag::serde]
impl Region for MockRegion {
fn contains(&self, _p: Meters) -> bool {
true