Struct shakmaty::ByColor[][src]

pub struct ByColor<T> {
    pub white: T,
    pub black: T,
}

Container with values for each Color.

Fields

white: Tblack: T

Implementations

impl<T> ByColor<T>[src]

pub fn new_with<F>(self, init: F) -> ByColor<T> where
    F: FnMut(Color) -> T, 
[src]

pub fn by_color(&self, color: Color) -> &T[src]

pub fn by_color_mut(&mut self, color: Color) -> &mut T[src]

pub fn into_color(self, color: Color) -> T[src]

pub fn flip(&mut self)[src]

pub fn into_flipped(self) -> ByColor<T>[src]

pub fn map<U, F>(self, f: F) -> ByColor<U> where
    F: FnMut(T) -> U, 
[src]

pub fn any<F>(&self, predicate: F) -> bool where
    F: FnMut(&T) -> bool
[src]

pub fn all<F>(&self, predicate: F) -> bool where
    F: FnMut(&T) -> bool
[src]

pub fn find<F>(&self, predicate: F) -> Option<Color> where
    F: FnMut(&T) -> bool
[src]

pub fn as_ref(&self) -> ByColor<&T>[src]

impl<T: PartialOrd> ByColor<T>[src]

pub fn normalize(&mut self)[src]

pub fn into_normalized(self) -> ByColor<T>[src]

impl<T: PartialEq> ByColor<T>[src]

pub fn is_symmetric(&self) -> bool[src]

impl<T: Copy> ByColor<&T>[src]

pub fn copied(self) -> ByColor<T>[src]

impl<T: Clone> ByColor<&T>[src]

pub fn cloned(self) -> ByColor<T>[src]

impl ByColor<MaterialSide>[src]

pub fn new() -> Material[src]

pub fn by_piece(&self, piece: Piece) -> u8[src]

pub fn by_piece_mut(&mut self, piece: Piece) -> &mut u8[src]

pub fn is_empty(&self) -> bool[src]

pub fn count(&self) -> usize[src]

pub fn has_pawns(&self) -> bool[src]

pub fn from_ascii(s: &[u8]) -> Result<Material, ParseMaterialError>[src]

pub fn from_ascii_fen(s: &[u8]) -> Result<Material, ParseMaterialError>[src]

pub fn fen(&self) -> String[src]

Trait Implementations

impl<'a> Add<&'a ByColor<MaterialSide>> for Material[src]

type Output = Material

The resulting type after applying the + operator.

impl Add<ByColor<MaterialSide>> for Material[src]

type Output = Material

The resulting type after applying the + operator.

impl<'a> AddAssign<&'a ByColor<MaterialSide>> for Material[src]

impl AddAssign<ByColor<MaterialSide>> for Material[src]

impl<T: Clone> Clone for ByColor<T>[src]

impl<T: Debug> Debug for ByColor<T>[src]

impl<T: Default> Default for ByColor<T>[src]

impl Display for ByColor<RemainingChecks>[src]

impl<T: Eq> Eq for ByColor<T>[src]

impl<T: Hash> Hash for ByColor<T>[src]

impl<T: PartialEq> PartialEq<ByColor<T>> for ByColor<T>[src]

impl<T> StructuralEq for ByColor<T>[src]

impl<T> StructuralPartialEq for ByColor<T>[src]

impl<'a> Sub<&'a ByColor<MaterialSide>> for Material[src]

type Output = Material

The resulting type after applying the - operator.

impl Sub<ByColor<MaterialSide>> for Material[src]

type Output = Material

The resulting type after applying the - operator.

impl<'a> SubAssign<&'a ByColor<MaterialSide>> for Material[src]

impl SubAssign<ByColor<MaterialSide>> for Material[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for ByColor<T> where
    T: RefUnwindSafe

impl<T> Send for ByColor<T> where
    T: Send

impl<T> Sync for ByColor<T> where
    T: Sync

impl<T> Unpin for ByColor<T> where
    T: Unpin

impl<T> UnwindSafe for ByColor<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.