pub enum FieldSchema {
String {
mutator: StringMutatorKind,
},
Float {
range: (f64, f64),
sigma: f64,
},
Integer {
range: (i64, i64),
sigma: f64,
},
Categorical {
choices: Vec<String>,
},
Set {
pool: Vec<String>,
max: Option<usize>,
},
}Expand description
One field in a Genome’s schema. Tagged enum so it serializes as JSON
like {"type": "float", "range": [0.0, 2.0], "sigma": 0.2}.
Variants§
String
A free-form string with a designated mutator strategy.
Fields
§
mutator: StringMutatorKindThe strategy for mutating this string field.
Float
A floating-point value bounded by range, mutated with Gaussian noise of std-dev sigma.
Fields
Integer
An integer value bounded by range, mutated with rounded Gaussian noise.
Fields
Categorical
One-of value, chosen from choices.
Set
A subset of values drawn from pool, optionally capped at max elements.
Trait Implementations§
Source§impl Clone for FieldSchema
impl Clone for FieldSchema
Source§fn clone(&self) -> FieldSchema
fn clone(&self) -> FieldSchema
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 FieldSchema
impl Debug for FieldSchema
Source§impl<'de> Deserialize<'de> for FieldSchema
impl<'de> Deserialize<'de> for FieldSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FieldSchema
impl PartialEq for FieldSchema
Source§impl Serialize for FieldSchema
impl Serialize for FieldSchema
impl StructuralPartialEq for FieldSchema
Auto Trait Implementations§
impl Freeze for FieldSchema
impl RefUnwindSafe for FieldSchema
impl Send for FieldSchema
impl Sync for FieldSchema
impl Unpin for FieldSchema
impl UnsafeUnpin for FieldSchema
impl UnwindSafe for FieldSchema
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