pub struct Chance { /* private fields */ }Implementations§
Source§impl Chance
impl Chance
Sourcepub fn new(chance: f32) -> Self
pub fn new(chance: f32) -> Self
Creates a new ChanceKind::Set chance value.
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Returns an unset chance object that is meant to be automatically determined by the system.
Sourcepub fn is_derived(&self) -> bool
pub fn is_derived(&self) -> bool
Returns true iff this is of kind ChanceKind::Derived
Sourcepub fn is_user_set(&self) -> bool
pub fn is_user_set(&self) -> bool
Returns true iff this is of kind ChanceKind::Set
pub fn expect(&self, message: &str) -> f32
pub fn unwrap(&self) -> f32
pub fn unwrap_or(&self, default: f32) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chance
impl RefUnwindSafe for Chance
impl Send for Chance
impl Sync for Chance
impl Unpin for Chance
impl UnwindSafe for Chance
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