pub enum RandomSpec {
ShuffledList {
options: Vec<String>,
},
Lottery {
options_and_weights: HashMap<String, u16>,
},
}Variants§
Implementations§
Source§impl RandomSpec
impl RandomSpec
pub fn as_options(self) -> Vec<String>
Sourcepub fn deck_of_cards() -> Self
pub fn deck_of_cards() -> Self
Create a deck of cards. Use A, 2-9, T, J, Q, K for kinds. Use S(spade), D(diamond), C(club), H(heart) for suits.
pub fn shuffled_list(options: Vec<String>) -> Self
pub fn lottery(options_and_weights: HashMap<String, u16>) -> Self
Trait Implementations§
Source§impl BorshDeserialize for RandomSpec
impl BorshDeserialize for RandomSpec
Source§impl BorshSerialize for RandomSpec
impl BorshSerialize for RandomSpec
Source§impl Debug for RandomSpec
impl Debug for RandomSpec
Source§impl PartialEq for RandomSpec
impl PartialEq for RandomSpec
impl Eq for RandomSpec
impl StructuralPartialEq for RandomSpec
Auto Trait Implementations§
impl Freeze for RandomSpec
impl RefUnwindSafe for RandomSpec
impl Send for RandomSpec
impl Sync for RandomSpec
impl Unpin for RandomSpec
impl UnwindSafe for RandomSpec
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