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
impl ParticleSearchQuery
Sourcepub fn name_contains(self, value: impl Into<String>) -> Self
pub fn name_contains(self, value: impl Into<String>) -> Self
Filters particles whose name contains value.
Sourcepub const fn class(self, particle_class: ParticleClass) -> Self
pub const fn class(self, particle_class: ParticleClass) -> Self
Filters particles by ParticleClass.
Sourcepub const fn particle_type(self, particle_type: ParticleType) -> Self
pub const fn particle_type(self, particle_type: ParticleType) -> Self
Filters particles by particle/antiparticle relation.
Sourcepub fn isospin(self, isospin: impl Into<Option<Isospin>>) -> Self
pub fn isospin(self, isospin: impl Into<Option<Isospin>>) -> Self
Filters particles by isospin.
Passing None requires the isospin value to be missing.
Sourcepub fn g_parity(self, g_parity: impl Into<Option<Parity>>) -> Self
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.
Sourcepub fn angular_momentum(
self,
angular_momentum: impl Into<Option<AngularMomentum>>,
) -> Self
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.
Sourcepub fn parity(self, parity: impl Into<Option<Parity>>) -> Self
pub fn parity(self, parity: impl Into<Option<Parity>>) -> Self
Filters particles by parity.
Passing None requires the parity value to be missing.
Sourcepub fn charge_conjugation(
self,
charge_conjugation: impl Into<Option<Parity>>,
) -> Self
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.
Sourcepub const fn mass_range_mev(self, min: f64, max: f64) -> Self
pub const fn mass_range_mev(self, min: f64, max: f64) -> Self
Filters particles whose mass interval overlaps the given range in MeV.
Sourcepub const fn width_range_mev(self, min: f64, max: f64) -> Self
pub const fn width_range_mev(self, min: f64, max: f64) -> Self
Filters particles whose width interval overlaps the given range in MeV.
Sourcepub const fn lifetime_range_seconds(self, min: f64, max: f64) -> Self
pub const fn lifetime_range_seconds(self, min: f64, max: f64) -> Self
Filters particles whose lifetime interval overlaps the given range in seconds.
Sourcepub fn decays_to<I, S>(self, states: I) -> Self
pub fn decays_to<I, S>(self, states: I) -> Self
Filters particles by an exact outgoing decay state.
Use ParticleSearchQuery::decay_contains to allow additional outgoing
products.
Sourcepub fn decay_contains<I, S>(self, states: I) -> Self
pub fn decay_contains<I, S>(self, states: I) -> Self
Filters particles by outgoing decay products contained in a decay state.
Sourcepub fn decays_from<I, S>(self, states: I) -> Self
pub fn decays_from<I, S>(self, states: I) -> Self
Filters particles by incoming decay products.
Sourcepub const fn decay_state_expansion(self, expansion: DecayStateExpansion) -> Self
pub const fn decay_state_expansion(self, expansion: DecayStateExpansion) -> Self
Sets decay-state expansion behavior.
Trait Implementations§
Source§impl Clone for ParticleSearchQuery
impl Clone for ParticleSearchQuery
Source§fn clone(&self) -> ParticleSearchQuery
fn clone(&self) -> ParticleSearchQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more