Struct vegas_lattice::Alloy
source · pub struct Alloy { /* private fields */ }
Expand description
An alloy is a collection of kinds of atoms and their ratios
It is used to pick a kind of atom from the alloy.
§Example
use vegas_lattice::Alloy;
let alloy = Alloy::new(vec!["Fe", "Ni"], vec![1, 2]);
let kind = alloy.pick(&mut rand::thread_rng());
assert!(kind == "Fe" || kind == "Ni");
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Alloy
impl Send for Alloy
impl Sync for Alloy
impl Unpin for Alloy
impl UnwindSafe for Alloy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more