Skip to main content

PdgParticle

Struct PdgParticle 

Source
pub struct PdgParticle<'pdg> {
    pub pdgid: PdgId,
    pub name: String,
    pub description: String,
    pub particle_type: ParticleType,
    pub particle_class: ParticleClass,
    pub mcid: Option<isize>,
    pub charge: Charge,
    pub quantum_i: Option<Isospin>,
    pub quantum_g: Option<Parity>,
    pub quantum_j: Option<AngularMomentum>,
    pub quantum_p: Option<Parity>,
    pub quantum_c: Option<Parity>,
    /* private fields */
}
Expand description

Particle row from the PDG database.

Fields§

§pdgid: PdgId

PDG identifier for the particle row.

§name: String

PDG item name.

§description: String

Human-readable PDG description.

§particle_type: ParticleType

Particle/antiparticle relationship.

§particle_class: ParticleClass

Broad particle class.

§mcid: Option<isize>

Monte Carlo particle ID, when assigned.

§charge: Charge

Electric charge.

§quantum_i: Option<Isospin>

Isospin quantum number.

§quantum_g: Option<Parity>

G-parity quantum number.

§quantum_j: Option<AngularMomentum>

Angular momentum quantum number.

§quantum_p: Option<Parity>

Parity quantum number.

§quantum_c: Option<Parity>

Charge-conjugation parity quantum number.

Implementations§

Source§

impl<'pdg> PdgParticle<'pdg>

Source

pub fn direct_property( &self, data_type: DataType, ) -> PdgResult<Option<DataEntry<'pdg>>>

Returns a latest-edition property stored directly under this particle.

§Errors

Returns a database error if the data query fails.

Source

pub fn property( &self, data_type: DataType, ) -> PdgResult<Option<ParticleProperty<'pdg>>>

Returns a latest-edition property, checking direct and section data.

§Errors

Returns a database error if data or child identifier queries fail.

Source

pub fn quantum_summary(&self) -> String

Returns a compact display string for charge and available quantum numbers.

Source

pub fn texts(&self) -> PdgResult<Vec<PdgText>>

Loads text blocks attached to this particle.

§Errors

Returns a database error if the text query fails.

Source

pub fn footnotes(&self) -> PdgResult<Vec<PdgFootnote>>

Loads footnotes attached to this particle.

§Errors

Returns a database error if the footnote query fails.

Source

pub fn item(&self) -> PdgResult<Option<PdgItem<'pdg>>>

Loads the item hierarchy node for this particle.

§Errors

Returns a database error if the item query fails.

Source

pub fn item_children(&self) -> PdgResult<Vec<PdgItemChild<'pdg>>>

Loads child items for this particle’s item name.

§Errors

Returns a database error if the item hierarchy query fails.

Source

pub fn parent_items(&self) -> PdgResult<Vec<PdgItem<'pdg>>>

Loads parent items for this particle’s item name.

§Errors

Returns a database error if the item hierarchy query fails.

Source

pub fn related_particles(&self) -> PdgResult<Vec<Self>>

Returns sibling particles related through the item hierarchy.

§Errors

Returns a database error if hierarchy or particle queries fail.

Source

pub fn measurements_for( &self, data_type: DataType, ) -> PdgResult<Vec<PdgMeasurement>>

Loads measurements supporting a property data type.

§Errors

Returns a database error if the property or measurement queries fail.

Source

pub fn mass(&self) -> PdgResult<Option<DataEntry<'pdg>>>

Returns the latest-edition mass entry, if available.

§Errors

Returns a database error if the property query fails.

Source

pub fn lifetime(&self) -> PdgResult<Option<DataEntry<'pdg>>>

Returns the latest-edition lifetime entry, if available.

§Errors

Returns a database error if the property query fails.

Source

pub fn width(&self) -> PdgResult<Option<DataEntry<'pdg>>>

Returns the latest-edition full-width entry, if available.

§Errors

Returns a database error if the property query fails.

Source

pub fn branching_fractions(&self) -> PdgResult<Vec<BranchingFraction<'pdg>>>

Returns exclusive and inclusive branching fractions for this particle.

§Errors

Returns a database error if branching data, decay products, or related data cannot be loaded.

Source

pub fn exclusive_branching_fractions( &self, ) -> PdgResult<Vec<BranchingFraction<'pdg>>>

Returns exclusive branching fractions for this particle.

§Errors

Returns a database error if branching data, decay products, or related data cannot be loaded.

Source

pub fn inclusive_branching_fractions( &self, ) -> PdgResult<Vec<BranchingFraction<'pdg>>>

Returns inclusive branching fractions for this particle.

§Errors

Returns a database error if branching data, decay products, or related data cannot be loaded.

Source

pub fn branching_ratios(&self) -> PdgResult<Vec<BranchingRatio<'pdg>>>

Returns branching-ratio rows for this particle.

§Errors

Returns a database error if branching-ratio data cannot be loaded.

Source

pub fn query_all_map<P, T>( &self, data_type: DataType, edition: impl Into<String>, predicate: P, ) -> PdgResult<Vec<T>>
where P: Fn(DataEntry<'pdg>) -> Option<T>,

Queries all latest matching data entries and maps them through predicate.

Entries for which predicate returns None are omitted.

§Errors

Returns a database error if the data query fails.

Source

pub fn query_map<P, T>( &self, data_type: DataType, edition: impl Into<String>, predicate: P, ) -> PdgResult<Option<T>>
where P: Fn(DataEntry<'pdg>) -> Option<T>,

Queries the first matching data entry and maps it through predicate.

§Errors

Returns a database error if the data query fails.

Source

pub fn query_all( &self, data_type: DataType, edition: impl Into<String>, ) -> PdgResult<Vec<DataEntry<'pdg>>>

Returns all data entries of data_type for a PDG edition.

§Errors

Returns a database error if the data query fails.

Source

pub fn query( &self, data_type: DataType, edition: impl Into<String>, ) -> PdgResult<Option<DataEntry<'pdg>>>

Returns the first data entry of data_type for a PDG edition.

§Errors

Returns a database error if the data query fails.

Trait Implementations§

Source§

impl<'pdg> Clone for PdgParticle<'pdg>

Source§

fn clone(&self) -> PdgParticle<'pdg>

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<'pdg> Debug for PdgParticle<'pdg>

Source§

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

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

impl Display for PdgParticle<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'pdg> !RefUnwindSafe for PdgParticle<'pdg>

§

impl<'pdg> !Send for PdgParticle<'pdg>

§

impl<'pdg> !Sync for PdgParticle<'pdg>

§

impl<'pdg> !UnwindSafe for PdgParticle<'pdg>

§

impl<'pdg> Freeze for PdgParticle<'pdg>

§

impl<'pdg> Unpin for PdgParticle<'pdg>

§

impl<'pdg> UnsafeUnpin for PdgParticle<'pdg>

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> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.