pub struct Material {
pub white: MaterialSide,
pub black: MaterialSide,
}
Expand description
The material configuration of both sides.
Fields
white: MaterialSide
black: MaterialSide
Implementations
sourceimpl Material
impl Material
pub fn new() -> Material
pub fn flip(&mut self)
pub fn flipped(&self) -> Material
pub fn normalize(&mut self)
pub fn normalized(&self) -> Material
pub fn is_symmetric(&self) -> bool
pub fn by_color(&self, color: Color) -> &MaterialSide
pub fn by_color_mut(&mut self, color: Color) -> &mut MaterialSide
pub fn by_piece(&self, piece: Piece) -> u8
pub fn by_piece_mut(&mut self, piece: Piece) -> &mut u8
pub fn count(&self) -> usize
pub fn has_pawns(&self) -> bool
pub fn from_ascii(s: &[u8]) -> Result<Material, ParseMaterialError>
pub fn from_ascii_fen(s: &[u8]) -> Result<Material, ParseMaterialError>
pub fn fen(&self) -> String
Trait Implementations
sourceimpl Extend<Piece> for Material
impl Extend<Piece> for Material
sourcefn extend<T: IntoIterator<Item = Piece>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Piece>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<Piece> for Material
impl FromIterator<Piece> for Material
sourcefn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = Piece>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = Piece>,
Creates a value from an iterator. Read more
sourceimpl FromStr for Material
impl FromStr for Material
type Err = ParseMaterialError
type Err = ParseMaterialError
The associated error which can be returned from parsing.
impl Eq for Material
impl StructuralEq for Material
impl StructuralPartialEq for Material
Auto Trait Implementations
impl RefUnwindSafe for Material
impl Send for Material
impl Sync for Material
impl Unpin for Material
impl UnwindSafe for Material
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more