Expand description
§use-particle
Small particle classification and metadata helpers for RustUse.
§Install
[dependencies]
use-particle = "0.0.1"§Foundation
use-particle provides small, dependency-free primitives for classifying common particles,
working with exact electric charge in thirds of the elementary charge, and looking up simple
particle metadata such as spin, statistics, and approximate rest mass.
§Example
use use_particle::{Particle, ParticleFamily, ParticleKind, antiparticle, charge};
let electron = Particle::new(ParticleKind::Electron);
assert_eq!(electron.family(), ParticleFamily::Lepton);
assert_eq!(charge(ParticleKind::Electron).thirds, -3);
assert_eq!(antiparticle(ParticleKind::Electron), Some(ParticleKind::Positron));§When to use directly
Choose use-particle when you need lightweight particle metadata without pulling in a broader
physics or chemistry model.
§Scope
- The crate stays intentionally small and does not try to be a complete particle physics database.
- Atomic structure, periodic table data, isotopes, electron shells, and chemistry concepts belong
in
use-chemistry. - General constants and unit systems belong in
use-constantsanduse-units. - Rest masses are approximate metadata for practical examples and should not be treated as precision reference data.
§Status
use-particle is a pre-1.0 crate with a deliberately small API.
Small particle classification and metadata helpers.
Modules§
Structs§
- Elementary
Charge - An exact electric charge expressed in thirds of the elementary charge.
- Particle
- A lightweight particle wrapper that delegates to the free helper functions.
- Spin
- A spin value expressed as doubled units of
hbar.
Enums§
- Particle
Family - Broad family groupings for the supported particles.
- Particle
Kind - Identifies a supported particle kind.
- Particle
Statistics - Spin-statistics classification for the supported particles.
Functions§
- antiparticle
- Returns the modeled antiparticle for
kind. - charge
- Returns the exact charge for
kind. - charge_
in_ elementary_ units - Returns the charge in elementary-charge units.
- charge_
thirds - Returns the exact charge in thirds of the elementary charge.
- family
- Returns the broad particle family for
kind. - has_
rest_ mass - Returns whether
kindhas nonzero rest mass when that metadata is modeled here. - is_
antiparticle - Returns
truewhenkindis represented as an antiparticle variant. - is_
baryon - Returns
truewhenkindis a baryon. - is_
boson - Returns
truewhenkindis a boson. - is_
fermion - Returns
truewhenkindis a fermion. - is_
lepton - Returns
truewhenkindis a lepton. - is_
meson - Returns
truewhenkindis a meson. - is_
quark - Returns
truewhenkindis a quark. - is_
self_ antiparticle - Returns
truewhenkindis its own antiparticle. - rest_
mass_ mev_ c2 - Returns an approximate rest mass in
MeV/c^2forkind. - spin
- Returns the spin for
kind. - statistics
- Returns the particle statistics implied by the modeled spin.