pub struct Taxon {
pub id: TaxonId,
pub name: String,
pub rank: Rank,
pub parent: TaxonId,
pub valid: bool,
}
Expand description
Represents a group of organisms with similar qualities.
Fields§
§id: TaxonId
The taxon’s unique id
name: String
The taxon’s name
rank: Rank
The rank of the taxon
parent: TaxonId
The taxon’s parent
valid: bool
Whether the taxon is valid. false
taxons are discarded in some calculations
Implementations§
Trait Implementations§
source§impl FromStr for Taxon
impl FromStr for Taxon
source§fn from_str(s: &str) -> Result<Self>
fn from_str(s: &str) -> Result<Self>
Parses a taxon from the given string.
§Fields
A line is defined by 5 columns, separated with a tab.
Note that all fields are required, in the following order:
id
,name
,rank
,parent
,valid
.
The valid
-field will be parsed as true for "\x01"
and false for "\x00"
.
§Examples
use umgap::taxon::Taxon;
let taxon = "1\tFelis catus\tspecies\t4\t\x01".parse::<Taxon>();
// Will return: Taxon {
// id: 1,
// name: "Felis catus",
// rank: Rank::Species,
// parent: 4,
// valid: true
// }
source§impl PartialEq for Taxon
impl PartialEq for Taxon
impl StructuralPartialEq for Taxon
Auto Trait Implementations§
impl RefUnwindSafe for Taxon
impl Send for Taxon
impl Sync for Taxon
impl Unpin for Taxon
impl UnwindSafe for Taxon
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