[−][src]Struct pleco::core::move_list::MoveList
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]
fn push_mv(&mut self, mv: BitMove)
[src]
unsafe fn unchecked_push_mv(&mut self, mv: BitMove)
[src]
unsafe fn unchecked_set_len(&mut self, len: usize)
[src]
unsafe fn list_ptr(&mut self) -> *mut BitMove
[src]
unsafe fn over_bounds_ptr(&mut self) -> *mut BitMove
[src]
impl Default for MoveList
[src]
impl From<Vec<BitMove>> for MoveList
[src]
impl From<ScoringMoveList> for MoveList
[src]
fn from(sc_list: ScoringMoveList) -> Self
[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?
fn into_iter(self) -> Self::IntoIter
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
impl Into<Vec<BitMove>> for MoveList
[src]
impl DerefMut for MoveList
[src]
impl Deref for MoveList
[src]
impl Index<usize> for MoveList
[src]
type Output = BitMove
The returned type after indexing.
fn index(&self, index: usize) -> &BitMove
[src]
impl IndexMut<usize> for MoveList
[src]
impl FromIterator<BitMove> for MoveList
[src]
fn from_iter<T: IntoIterator<Item = BitMove>>(iter: T) -> Self
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,