pub enum ActionError {
UnknownSpell(String),
SpellNotPrepared(String),
NotARitual(String),
SlotTooLow {
spell: String,
spell_level: u8,
slot_level: u8,
},
NoSlotsOfLevel(u8),
NoSlotsRemaining(u8),
NoPactMagic,
PactLevelMismatch {
pact_level: u8,
requested: u8,
},
NoPactSlotsRemaining,
UnknownResource(String),
NotEnoughUses {
name: String,
remaining: u16,
requested: u16,
},
}Expand description
Why an action can’t be applied.
Variants§
UnknownSpell(String)
SpellNotPrepared(String)
NotARitual(String)
SlotTooLow
NoSlotsOfLevel(u8)
NoSlotsRemaining(u8)
NoPactMagic
PactLevelMismatch
NoPactSlotsRemaining
UnknownResource(String)
NotEnoughUses
Implementations§
Source§impl ActionError
impl ActionError
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
True when the action was well-formed but the character has run out of whatever it needed. Lets clients distinguish “you’re out of slots” from “that spell doesn’t exist”.
Trait Implementations§
Source§impl Clone for ActionError
impl Clone for ActionError
Source§fn clone(&self) -> ActionError
fn clone(&self) -> ActionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActionError
impl Debug for ActionError
Source§impl Display for ActionError
impl Display for ActionError
Source§impl Error for ActionError
impl Error for ActionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ActionError
impl PartialEq for ActionError
Source§fn eq(&self, other: &ActionError) -> bool
fn eq(&self, other: &ActionError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ActionError
impl StructuralPartialEq for ActionError
Auto Trait Implementations§
impl Freeze for ActionError
impl RefUnwindSafe for ActionError
impl Send for ActionError
impl Sync for ActionError
impl Unpin for ActionError
impl UnsafeUnpin for ActionError
impl UnwindSafe for ActionError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.