Skip to main content

Informal

Struct Informal 

Source
pub struct Informal {
    pub taxon: String,
    pub taxon_rank: Rank,
    pub rank: Rank,
    pub phrase: Option<String>,
    pub code: Option<NomCode>,
}
Expand description

An informal / semistructured name — the payload of crate::ParseResult::Informal, mirroring Java org.gbif.nameparser.api.ParseResult.Informal.

A real supraspecific taxon (Self::taxon, a genus or higher uninomial) carrying a provisional, non-code designation instead of a determined species epithet: a molecular provisional species (Rhizobium sp. RMCC TR1811), a numbered placeholder (Allium sp. 1), or an informal group. The 67.5M verbatim-corpus study found these are 5.5% of all real names — 1 in 18 — hence a first-class representation.

Deliberately a FLAT type, not a reused ParsedName: the anchor lives in one place (Self::taxon + Self::taxon_rank) and is never mislabelled as a backbone-validated “genus”. Derived from an informal ParsedName at the crate::parse boundary. Only names with NO species epithet land here; a binomial core (incl. cf./aff. and infraspecific-indet) stays crate::ParseResult::Parsed so its specific_authorship is preserved.

Fields§

§taxon: String

The supraspecific taxon it hangs off ("Rhizobium", "Ichneumonidae") — the parser’s best guess, NOT validated against a taxonomic backbone.

§taxon_rank: Rank

That taxon’s rank — GENUS for the overwhelming Genus sp. majority (the anchor sits in the genus slot); a bare supraspecific monomial carries its own rank. The parser’s best guess.

§rank: Rank

The rank the informal name purports to be — SPECIES for "sp.", UNRANKED for a group.

§phrase: Option<String>

The VERBATIM tail, from the rank marker to the end of the input ("sp. RMCC TR1811", "sp. 1"); None only when there is no tail at all. An informal name is not fully parsable by definition, so the tail is captured whole and nothing in it is interpreted — it may therefore contain what looks like an author citation ("sp. Forster, 1968"), which is NOT separately parsed. That is deliberate: the parser cannot reliably tell a citation from a specimen or culture code (43% of the tails the pre-5.0.0 rule read as authorship were spurious — impossible years, collection acronyms like ZRC/MNHN), and on the genuinely authored minority the citation belongs to the Self::taxon anchor rather than to the undetermined species. taxon + " " + phrase reproduces the input exactly.

§code: Option<NomCode>

The nomenclatural code when known, else None.

Implementations§

Source§

impl Informal

Source

pub fn canonical_name(&self) -> String

The canonical string form of this informal name — e.g. "Rhizobium sp. RMCC TR1811", "Ichneumonidae sp.", "Bartonella group". Mirrors Java NameFormatter.canonical(Informal): it rebuilds the equivalent INFORMAL ParsedName — the Informal::taxon in the genus slot, or the uninomial slot for a non-genus anchor — and renders it through ParsedName::canonical_name_without_authorship, so the synthetic sp. marker and the phrase land exactly where the parser would place them. Never empty: falls back to the bare taxon should the rebuilt name render nothing. Named to parallel ParsedName::canonical_name so bindings expose one method across both result variants.

Trait Implementations§

Source§

impl Clone for Informal

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Informal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Informal

Source§

impl PartialEq for Informal

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Informal

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Informal

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.