Struct shakmaty::ByCastlingSide
source · #[repr(C)]pub struct ByCastlingSide<T> {
pub king_side: T,
pub queen_side: T,
}
Expand description
Container with values for each CastlingSide
.
Fields§
§king_side: T
§queen_side: T
Implementations§
source§impl<T> ByCastlingSide<T>
impl<T> ByCastlingSide<T>
pub fn new_with<F>(init: F) -> ByCastlingSide<T>where
F: FnMut(CastlingSide) -> T,
pub const fn get(&self, side: CastlingSide) -> &T
pub fn get_mut(&mut self, side: CastlingSide) -> &mut T
pub fn swap(&mut self)
pub fn into_flipped(self) -> ByCastlingSide<T>
pub fn for_each<F>(self, f: F)where
F: FnMut(T),
pub fn map<U, F>(self, f: F) -> ByCastlingSide<U>where
F: FnMut(T) -> U,
pub fn find<F>(&self, predicate: F) -> Option<CastlingSide>
pub const fn as_ref(&self) -> ByCastlingSide<&T>
pub fn as_mut(&mut self) -> ByCastlingSide<&mut T>
pub fn zip<U>(self, other: ByCastlingSide<U>) -> ByCastlingSide<(T, U)>
pub fn zip_castling_side(self) -> ByCastlingSide<(CastlingSide, T)>
pub fn iter(&self) -> IntoIter<&T, 2>
pub fn iter_mut(&mut self) -> IntoIter<&mut T, 2>
source§impl<T: Copy> ByCastlingSide<&T>
impl<T: Copy> ByCastlingSide<&T>
pub fn copied(self) -> ByCastlingSide<T>
source§impl<T: Clone> ByCastlingSide<&T>
impl<T: Clone> ByCastlingSide<&T>
pub fn cloned(self) -> ByCastlingSide<T>
Trait Implementations§
source§impl<T: Clone> Clone for ByCastlingSide<T>
impl<T: Clone> Clone for ByCastlingSide<T>
source§fn clone(&self) -> ByCastlingSide<T>
fn clone(&self) -> ByCastlingSide<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for ByCastlingSide<T>
impl<T: Debug> Debug for ByCastlingSide<T>
source§impl<T: Default> Default for ByCastlingSide<T>
impl<T: Default> Default for ByCastlingSide<T>
source§fn default() -> ByCastlingSide<T>
fn default() -> ByCastlingSide<T>
Returns the “default value” for a type. Read more
source§impl<T: Hash> Hash for ByCastlingSide<T>
impl<T: Hash> Hash for ByCastlingSide<T>
source§impl<T> IntoIterator for ByCastlingSide<T>
impl<T> IntoIterator for ByCastlingSide<T>
source§impl<T: PartialEq> PartialEq for ByCastlingSide<T>
impl<T: PartialEq> PartialEq for ByCastlingSide<T>
source§fn eq(&self, other: &ByCastlingSide<T>) -> bool
fn eq(&self, other: &ByCastlingSide<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Copy> Copy for ByCastlingSide<T>
impl<T: Eq> Eq for ByCastlingSide<T>
impl<T> StructuralPartialEq for ByCastlingSide<T>
Auto Trait Implementations§
impl<T> Freeze for ByCastlingSide<T>where
T: Freeze,
impl<T> RefUnwindSafe for ByCastlingSide<T>where
T: RefUnwindSafe,
impl<T> Send for ByCastlingSide<T>where
T: Send,
impl<T> Sync for ByCastlingSide<T>where
T: Sync,
impl<T> Unpin for ByCastlingSide<T>where
T: Unpin,
impl<T> UnwindSafe for ByCastlingSide<T>where
T: UnwindSafe,
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