pub struct Powder { /* private fields */ }
Expand description
Struct representing a powder
Implementations§
Source§impl Powder
impl Powder
Sourcepub fn new(element: Element, tier: u8) -> Result<Self, InvalidPowderTier>
pub fn new(element: Element, tier: u8) -> Result<Self, InvalidPowderTier>
Create a new powder with the given element and tier. You may also use Powder::try_from((element, tier))
to create a powder.
§Errors
Creating a powder will fail if the tier is not between 1 and 6
Sourcepub fn set_element(&mut self, element: Element)
pub fn set_element(&mut self, element: Element)
Set the element of this powder
Sourcepub fn valid_tier(tier: u8) -> bool
pub fn valid_tier(tier: u8) -> bool
Check if the given tier is valid for a powder
Trait Implementations§
impl Copy for Powder
impl Eq for Powder
impl StructuralPartialEq for Powder
Auto Trait Implementations§
impl Freeze for Powder
impl RefUnwindSafe for Powder
impl Send for Powder
impl Sync for Powder
impl Unpin for Powder
impl UnwindSafe for Powder
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