Skip to main content

Crate use_taxonomy

Crate use_taxonomy 

Source
Expand description

§use-taxonomy

Primitive biological classification vocabulary.

use-taxonomy models taxon names, ranks, taxa, scientific/common names, and ordered lineages. It does not maintain an authoritative taxonomy database, fetch taxonomy data, resolve synonyms, infer classification, or model phylogenetic trees.

use use_taxonomy::{Taxon, TaxonName, TaxonomicLineage, TaxonomicRank};

let kingdom = Taxon::new(TaxonomicRank::Kingdom, TaxonName::new("Animalia").unwrap());
let genus = Taxon::new(TaxonomicRank::Genus, TaxonName::new("Homo").unwrap());
let lineage = TaxonomicLineage::new(vec![kingdom, genus]);

assert_eq!(lineage.len(), 2);
assert_eq!(lineage.taxa()[1].to_string(), "genus: Homo");

Structs§

CommonName
A non-empty common name.
ScientificName
A non-empty scientific name.
Taxon
A taxon represented by rank and validated name.
TaxonName
A non-empty taxon name.
TaxonomicLineage
An ordered taxonomic lineage.

Enums§

TaxonomicRank
Broad biological rank vocabulary.
TaxonomicRankParseError
Error returned when parsing a taxonomic rank fails.
TaxonomyNameError
Error returned when taxonomy names are empty.