Enum race_api::random::RandomSpec
source · 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 RandomSpecwhere
Vec<String>: BorshDeserialize,
HashMap<String, u16>: BorshDeserialize,
impl BorshDeserialize for RandomSpecwhere Vec<String>: BorshDeserialize, HashMap<String, u16>: BorshDeserialize,
source§impl BorshSerialize for RandomSpecwhere
Vec<String>: BorshSerialize,
HashMap<String, u16>: BorshSerialize,
impl BorshSerialize for RandomSpecwhere Vec<String>: BorshSerialize, HashMap<String, u16>: BorshSerialize,
source§impl Debug for RandomSpec
impl Debug for RandomSpec
source§impl PartialEq<RandomSpec> for RandomSpec
impl PartialEq<RandomSpec> for RandomSpec
source§fn eq(&self, other: &RandomSpec) -> bool
fn eq(&self, other: &RandomSpec) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for RandomSpec
impl StructuralEq for RandomSpec
impl StructuralPartialEq for RandomSpec
Auto Trait Implementations§
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