Skip to main content

ContributionReason

Enum ContributionReason 

Source
pub enum ContributionReason {
Show 15 variants AlreadyAromaticContext, CarbonEndocyclicDouble, CarbonExocyclicHeteroatomDouble, CarbonCarbanionLonePair, CarbonCationVacant, CarbonSp3Ineligible, NitrogenPyrroleTypeH, NitrogenPyridineTypeExplicitDouble, NitrogenBridgeheadOrSubstitutedLonePair, NitrogenAromaticInRing, NitrogenIneligible, ChalcogenLonePair, ChalcogenCationPyridineType, ChalcogenIneligible, UnsupportedElement,
}
Expand description

Reason a ring atom contributes (or fails to contribute) pi electrons, mirroring ring_pi_electrons’s branches one-to-one. Purely diagnostic.

Variants§

§

AlreadyAromaticContext

Already aromatic from a previous Pass 1/Pass 2 ring: contributes 1π unconditionally.

§

CarbonEndocyclicDouble

Carbon with an endocyclic double/aromatic bond: 1π.

§

CarbonExocyclicHeteroatomDouble

Carbon whose only double bond is exocyclic to O/N/S: 0π (e.g. a carbonyl carbon).

§

CarbonCarbanionLonePair

Carbanion with no double bond: 2π (lone pair).

§

CarbonCationVacant

Cationic ring carbon (e.g. tropylium’s [cH+]): empty p-orbital electron acceptor, 0π, regardless of representation (Kekule or aromatic-bond) – mirrors CarbonCarbanionLonePair’s anion rule at the opposite electron-count extreme.

§

CarbonSp3Ineligible

sp3 carbon (no double bond, not a carbanion): ineligible.

§

NitrogenPyrroleTypeH

Pyrrole-type N with an H, neutral or anionic: 2π.

§

NitrogenPyridineTypeExplicitDouble

Pyridine-type N with an explicit double bond (bare, or protonated N-H+ once it has a Kekule double bond): 1π.

§

NitrogenBridgeheadOrSubstitutedLonePair

Bridgehead N (or N-substituted azole N), neutral or anionic: all-sigma valence, lone pair in p orbital: 2π.

§

NitrogenAromaticInRing

N with an in-ring aromatic bond, not a bridgehead (pyridine-type notation, or a charged N-H+ in aromatic-bond representation): 1π.

§

NitrogenIneligible

N matching none of the above rules: ineligible.

§

ChalcogenLonePair

O/S/Se/Te lone-pair donor, neutral or anionic, ring-degree 2: 2π.

§

ChalcogenCationPyridineType

Charged O/S (e.g. pyrylium’s [o+]): the positive charge consumes the lone pair, so this atom needs pyridine-type treatment (1π via its own ring double/aromatic bond) instead of donating 2π.

§

ChalcogenIneligible

O/S/Se/Te with the wrong ring degree, an exocyclic X=O, (Se/Te) non-RdkitLike mode, or a charged O/S with no ring double/aromatic bond to fall back on: ineligible.

§

UnsupportedElement

Element not supported by the model: ineligible.

Implementations§

Source§

impl ContributionReason

Source

pub fn is_eligible(self) -> bool

Whether this reason is an eligible contribution (matches ring_pi_electrons returning Some) rather than one that disqualifies the whole ring (matches it returning None).

Source

pub fn eligibility(self) -> PiEligibility

Coarse PiEligibility bucket for this fine-grained reason (Aromaticity-A1-1a). AlreadyAromaticContext has no single fixed bucket – it always carries exactly 1π, so it maps to OneElectron.

Trait Implementations§

Source§

impl Clone for ContributionReason

Source§

fn clone(&self) -> ContributionReason

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 Copy for ContributionReason

Source§

impl Debug for ContributionReason

Source§

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

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

impl Eq for ContributionReason

Source§

impl PartialEq for ContributionReason

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ContributionReason

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.