[][src]Struct pleco::core::move_list::MoveList

pub struct MoveList { /* fields omitted */ }

This is the list of possible moves for a current position. Think of it alike a faster version of Vec<BitMove>, as all the data is stored in the Stack rather than the Heap.

Methods

impl MoveList[src]

pub fn push(&mut self, mv: BitMove)[src]

Adds a BitMove to the end of the list.

Safety

If pushing to the list when at capacity, does nothing.

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

Returns true if empty.

Examples

use pleco::{BitMove,MoveList};

let mut list = MoveList::default();
assert!(list.is_empty());

pub fn vec(&self) -> Vec<BitMove>[src]

Creates a Vec<BitMove> from this MoveList.

Examples

use pleco::{BitMove,MoveList};

let mut list = MoveList::default();
list.push(BitMove::null());

let vec: Vec<BitMove> = list.vec();

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

Returns the number of moves inside the list.

Examples

use pleco::{BitMove,MoveList};

let mut list = MoveList::default();
list.push(BitMove::null());
list.push(BitMove::null());
list.push(BitMove::null());
assert_eq!(list.len(), 3);

pub fn as_slice(&self) -> &[BitMove][src]

Returns the MoveList as a slice.

Examples

use pleco::{BitMove,MoveList};

let mut list = MoveList::default();
list.push(BitMove::null());

let slice: &[BitMove] = list.as_slice();

pub fn as_mut_slice(&mut self) -> &mut [BitMove][src]

Returns the MoveList as a mutable slice.

Trait Implementations

impl MVPushable for MoveList[src]

impl Default for MoveList[src]

impl From<Vec<BitMove>> for MoveList[src]

impl From<ScoringMoveList> for MoveList[src]

impl From<MoveList> for ScoringMoveList[src]

impl<'a> IntoIterator for &'a MoveList[src]

type Item = BitMove

The type of the elements being iterated over.

type IntoIter = MoveIter<'a>

Which kind of iterator are we turning this into?

impl IntoIterator for MoveList[src]

type Item = BitMove

The type of the elements being iterated over.

type IntoIter = MoveIntoIter

Which kind of iterator are we turning this into?

impl Into<Vec<BitMove>> for MoveList[src]

impl DerefMut for MoveList[src]

impl Deref for MoveList[src]

type Target = [BitMove]

The resulting type after dereferencing.

impl Index<usize> for MoveList[src]

type Output = BitMove

The returned type after indexing.

impl IndexMut<usize> for MoveList[src]

impl FromIterator<BitMove> for MoveList[src]

Auto Trait Implementations

impl Send for MoveList

impl Sync for MoveList

Blanket Implementations

impl<T> From for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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