pub struct CharGene { /* private fields */ }Expand description
A gene that represents a single character. The allele is a char
that is randomly selected from the [ALPHABET] constant.
§Example
use radiate_core::*;
// Create a new CharGene with a random allele from the ALPHABET constant.
let gene = CharGene::default();
// Get the allele of the CharGene.
let allele = gene.allele();
// Create a new CharGene from the allele.
let gene = gene.with_allele(allele);Implementations§
Trait Implementations§
Source§impl From<CharGene> for CharChromosome
impl From<CharGene> for CharChromosome
Source§fn from(gene: CharGene) -> CharChromosome
fn from(gene: CharGene) -> CharChromosome
Converts to this type from the input type.
Source§impl FromIterator<CharGene> for CharChromosome
impl FromIterator<CharGene> for CharChromosome
Source§fn from_iter<I>(iter: I) -> CharChromosomewhere
I: IntoIterator<Item = CharGene>,
fn from_iter<I>(iter: I) -> CharChromosomewhere
I: IntoIterator<Item = CharGene>,
Creates a value from an iterator. Read more
Source§impl Gene for CharGene
Implement the Gene trait for the CharGene. This allows the CharGene to be used in
a Chromosome - specifically the CharChromosome, thus allowing the CharGene to
be used in the GeneticEngine.
impl Gene for CharGene
Implement the Gene trait for the CharGene. This allows the CharGene to be used in
a Chromosome - specifically the CharChromosome, thus allowing the CharGene to
be used in the GeneticEngine.
impl StructuralPartialEq for CharGene
Auto Trait Implementations§
impl Freeze for CharGene
impl RefUnwindSafe for CharGene
impl Send for CharGene
impl Sync for CharGene
impl Unpin for CharGene
impl UnsafeUnpin for CharGene
impl UnwindSafe for CharGene
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