Trait Condition

Source
pub trait Condition {
    type Error;

    // Required methods
    fn check(&mut self, vector: Vector) -> MoveMask;
    fn ok(self) -> Result<(), Self::Error>;
}
Available on crate feature require only.
Expand description

A Condition is used internally by the Requirement trait. requirement! will expand into a constant function which returns a type that implements this trait.

Required Associated Types§

Source

type Error

The error type associated with the requirement. When used in requirements all the error types must implement Into to a common type.

Required Methods§

Source

fn check(&mut self, vector: Vector) -> MoveMask

Used internally by the requirements! macro.

Source

fn ok(self) -> Result<(), Self::Error>

Check that the condition was met at least once, used internally by the requirements! macro

Implementors§

Source§

impl<C, Raise, Err> Condition for Requires<C, Raise, Err>
where C: Fn(Vector) -> Vector, Raise: FnOnce() -> Err,

Source§

type Error = Err