Skip to main content

Crate use_particle

Crate use_particle 

Source
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-constants and use-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§

prelude

Structs§

ElementaryCharge
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§

ParticleFamily
Broad family groupings for the supported particles.
ParticleKind
Identifies a supported particle kind.
ParticleStatistics
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 kind has nonzero rest mass when that metadata is modeled here.
is_antiparticle
Returns true when kind is represented as an antiparticle variant.
is_baryon
Returns true when kind is a baryon.
is_boson
Returns true when kind is a boson.
is_fermion
Returns true when kind is a fermion.
is_lepton
Returns true when kind is a lepton.
is_meson
Returns true when kind is a meson.
is_quark
Returns true when kind is a quark.
is_self_antiparticle
Returns true when kind is its own antiparticle.
rest_mass_mev_c2
Returns an approximate rest mass in MeV/c^2 for kind.
spin
Returns the spin for kind.
statistics
Returns the particle statistics implied by the modeled spin.