[−][src]Enum weasel::error::WeaselError
Error type for all kind of errors generated by weasel.
Variants
A generic error.
Duplicated creature id.
Duplicated object id.
Duplicated team id.
The team doesn't exist.
The creature doesn't exist.
The object doesn't exist.
NewCreatureUnaccepted(TI, Box<Self>)
Creation of creatures is disabled.
ConvertedCreatureUnaccepted(TI, CI, Box<Self>)
The creature can't be transferred to the team.
This creature conversion is not valid.
The team is not empty.
Position is invalid.
The entity doesn't exist.
The event id is not contiguous.
A turn is already in progress.
No turn is in progress.
The actor can't start a new turn.
The actor can't act at the moment.
The actor doesn't know such ability.
AbilityNotActivable(EI, AI, Box<Self>)
The ability can't be activated.
The team can't act at the moment.
The team doesn't possess such power.
PowerNotInvocable(TI, WI, Box<Self>)
The power can't be invoked.
Status not present on a character.
The event processor is not valid.
The entity is not a character.
The entity is not an actor.
The entity is not a creature.
The entity is not an object.
Attempt to set Relation::Kin
.
Attempt to set relation towards oneself.
Two versions of the battle rules are incompatible.
The battle has already ended.
The metric's type is not correct.
The EventPrototype
's condition is not satisfied.
DuplicatedEventSink(EventSinkId)
Duplicated event sink id.
The event range is invalid.
EventSinkNotFound(EventSinkId)
The event sink doesn't exist.
The player can't fire the event.
No authentication in the event.
Event can be fired only be the server.
UserEventPackingError(E, String)
Failure while packing an user event into a UserEventPacker
.
UserEventUnpackingError(String)
Failure while unpacking a UserEventPacker
into an user event.
InvalidEvent(E, Box<Self>)
The event is invalid.
MultiError(Vec<Self>)
An error containing multiple inner errors.
UserError(String)
An user defined error.
EventSinkError(String)
A generic event sink error.
Implementations
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
[src]
pub fn unfold(self) -> Self
[src]
Unfolds an error, return the inner one in case the original is an InvalidEvent
.
If not, it returns the original.
In the case of MultiError
, unfolds all contained errors.
Examples
use weasel::{ battle_rules, error::WeaselErrorType, event::DummyEvent, rules::empty::*, BattleRules, EventTrigger, WeaselError, }; battle_rules! {} let mut processor = (); let trigger = DummyEvent::trigger(&mut processor); let error: WeaselErrorType<CustomRules> = WeaselError::InvalidEvent(trigger.event(), Box::new(WeaselError::EmptyEventProcessor)); assert_eq!(error.unfold(), WeaselError::EmptyEventProcessor);
pub fn filter<F>(self, op: F) -> Result<(), Self> where
F: Fn(&Self) -> bool + Copy,
[src]
F: Fn(&Self) -> bool + Copy,
Consumes this error and filters it with the given filter
function.
filter
is applied to this error, to the error inside InvalidEvent
and to all errors contained by MultiError
.
Only the errors for which filter
returns true are kept.
Examples
use weasel::{ battle_rules, error::WeaselErrorType, event::DummyEvent, rules::empty::*, BattleRules, EventTrigger, WeaselError, }; battle_rules! {} let mut processor = (); let trigger = DummyEvent::trigger(&mut processor); let error: WeaselErrorType<CustomRules> = WeaselError::InvalidEvent(trigger.event(), Box::new(WeaselError::EmptyEventProcessor)); assert_eq!( error .filter(|err| { if let WeaselError::EmptyEventProcessor = err { false } else { true } }) .err(), None );
Trait Implementations
impl<V: Clone, TI: Clone, EI: Clone, CI: Clone, OI: Clone, PI: Clone, AI: Clone, WI: Clone, SI: Clone, MI: Clone, E: Clone> Clone for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
[src]
fn clone(&self) -> WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<V: Debug, TI: Debug, EI: Debug, CI: Debug, OI: Debug, PI: Debug, AI: Debug, WI: Debug, SI: Debug, MI: Debug, E: Debug> Debug for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
[src]
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> Display for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> where
V: Debug,
TI: Debug,
EI: Debug,
CI: Debug,
OI: Debug,
PI: Debug,
AI: Debug,
WI: Debug,
SI: Debug,
MI: Debug,
E: Debug,
[src]
V: Debug,
TI: Debug,
EI: Debug,
CI: Debug,
OI: Debug,
PI: Debug,
AI: Debug,
WI: Debug,
SI: Debug,
MI: Debug,
E: Debug,
impl<V: PartialEq, TI: PartialEq, EI: PartialEq, CI: PartialEq, OI: PartialEq, PI: PartialEq, AI: PartialEq, WI: PartialEq, SI: PartialEq, MI: PartialEq, E: PartialEq> PartialEq<WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>> for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
[src]
fn eq(
&self,
other: &WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
) -> bool
[src]
&self,
other: &WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
) -> bool
fn ne(
&self,
other: &WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
) -> bool
[src]
&self,
other: &WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
) -> bool
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> StructuralPartialEq for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E>
[src]
Auto Trait Implementations
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> RefUnwindSafe for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> where
AI: RefUnwindSafe,
CI: RefUnwindSafe,
E: RefUnwindSafe,
EI: RefUnwindSafe,
MI: RefUnwindSafe,
OI: RefUnwindSafe,
PI: RefUnwindSafe,
SI: RefUnwindSafe,
TI: RefUnwindSafe,
V: RefUnwindSafe,
WI: RefUnwindSafe,
AI: RefUnwindSafe,
CI: RefUnwindSafe,
E: RefUnwindSafe,
EI: RefUnwindSafe,
MI: RefUnwindSafe,
OI: RefUnwindSafe,
PI: RefUnwindSafe,
SI: RefUnwindSafe,
TI: RefUnwindSafe,
V: RefUnwindSafe,
WI: RefUnwindSafe,
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> Send for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> where
AI: Send,
CI: Send,
E: Send,
EI: Send,
MI: Send,
OI: Send,
PI: Send,
SI: Send,
TI: Send,
V: Send,
WI: Send,
AI: Send,
CI: Send,
E: Send,
EI: Send,
MI: Send,
OI: Send,
PI: Send,
SI: Send,
TI: Send,
V: Send,
WI: Send,
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> Sync for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> where
AI: Sync,
CI: Sync,
E: Sync,
EI: Sync,
MI: Sync,
OI: Sync,
PI: Sync,
SI: Sync,
TI: Sync,
V: Sync,
WI: Sync,
AI: Sync,
CI: Sync,
E: Sync,
EI: Sync,
MI: Sync,
OI: Sync,
PI: Sync,
SI: Sync,
TI: Sync,
V: Sync,
WI: Sync,
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> Unpin for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> where
AI: Unpin,
CI: Unpin,
E: Unpin,
EI: Unpin,
MI: Unpin,
OI: Unpin,
PI: Unpin,
SI: Unpin,
TI: Unpin,
V: Unpin,
WI: Unpin,
AI: Unpin,
CI: Unpin,
E: Unpin,
EI: Unpin,
MI: Unpin,
OI: Unpin,
PI: Unpin,
SI: Unpin,
TI: Unpin,
V: Unpin,
WI: Unpin,
impl<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> UnwindSafe for WeaselError<V, TI, EI, CI, OI, PI, AI, WI, SI, MI, E> where
AI: UnwindSafe,
CI: UnwindSafe,
E: UnwindSafe,
EI: UnwindSafe,
MI: UnwindSafe,
OI: UnwindSafe,
PI: UnwindSafe,
SI: UnwindSafe,
TI: UnwindSafe,
V: UnwindSafe,
WI: UnwindSafe,
AI: UnwindSafe,
CI: UnwindSafe,
E: UnwindSafe,
EI: UnwindSafe,
MI: UnwindSafe,
OI: UnwindSafe,
PI: UnwindSafe,
SI: UnwindSafe,
TI: UnwindSafe,
V: UnwindSafe,
WI: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,