Skip to main content

ParticleSearchQuery

Struct ParticleSearchQuery 

Source
pub struct ParticleSearchQuery { /* private fields */ }
Expand description

Builder for particle searches run by crate::Pdg::search_particles.

Filters are combined with logical AND.

§Examples

use pdg_rs::{Charge, ParticleClass, ParticleSearchQuery, Pdg};

let query = ParticleSearchQuery::new()
    .class(ParticleClass::Meson)
    .charge(Charge::Neutral)
    .mass_range_mev(100.0, 1000.0);

let pdg = Pdg::open()?;
let particles = pdg.search_particles(query)?;
assert!(particles.iter().all(|particle| particle.charge == Charge::Neutral));

Implementations§

Source§

impl ParticleSearchQuery

Source

pub fn new() -> Self

Creates an empty particle search query.

Source

pub fn name_contains(self, value: impl Into<String>) -> Self

Filters particles whose name contains value.

Source

pub const fn class(self, particle_class: ParticleClass) -> Self

Filters particles by ParticleClass.

Source

pub const fn particle_type(self, particle_type: ParticleType) -> Self

Filters particles by particle/antiparticle relation.

Source

pub const fn charge(self, charge: Charge) -> Self

Filters particles by electric charge.

Source

pub fn isospin(self, isospin: impl Into<Option<Isospin>>) -> Self

Filters particles by isospin.

Passing None requires the isospin value to be missing.

Source

pub fn g_parity(self, g_parity: impl Into<Option<Parity>>) -> Self

Filters particles by G-parity.

Passing None requires the G-parity value to be missing.

Source

pub fn angular_momentum( self, angular_momentum: impl Into<Option<AngularMomentum>>, ) -> Self

Filters particles by angular momentum.

Passing None requires the angular-momentum value to be missing.

Source

pub fn parity(self, parity: impl Into<Option<Parity>>) -> Self

Filters particles by parity.

Passing None requires the parity value to be missing.

Source

pub fn charge_conjugation( self, charge_conjugation: impl Into<Option<Parity>>, ) -> Self

Filters particles by charge-conjugation parity.

Passing None requires the charge-conjugation value to be missing.

Source

pub const fn mass_range_mev(self, min: f64, max: f64) -> Self

Filters particles whose mass interval overlaps the given range in MeV.

Source

pub const fn width_range_mev(self, min: f64, max: f64) -> Self

Filters particles whose width interval overlaps the given range in MeV.

Source

pub const fn lifetime_range_seconds(self, min: f64, max: f64) -> Self

Filters particles whose lifetime interval overlaps the given range in seconds.

Source

pub fn decays_to<I, S>(self, states: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Filters particles by an exact outgoing decay state.

Use ParticleSearchQuery::decay_contains to allow additional outgoing products.

Source

pub fn decay_contains<I, S>(self, states: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Filters particles by outgoing decay products contained in a decay state.

Source

pub fn decays_from<I, S>(self, states: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Filters particles by incoming decay products.

Source

pub const fn decay_state_expansion(self, expansion: DecayStateExpansion) -> Self

Sets decay-state expansion behavior.

Trait Implementations§

Source§

impl Clone for ParticleSearchQuery

Source§

fn clone(&self) -> ParticleSearchQuery

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 ParticleSearchQuery

Source§

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

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

impl Default for ParticleSearchQuery

Source§

fn default() -> ParticleSearchQuery

Returns the “default value” for a type. Read more

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> 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, 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.