pub struct Stack { /* private fields */ }Implementations§
Source§impl Stack
impl Stack
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Check if anything is in this stack. If false, it means the square is empty.
pub const fn colors(&self) -> Colors
Sourcepub fn road(&self, color: Color) -> bool
pub fn road(&self, color: Color) -> bool
Check if this stack contributes to roads for the given color.
Sourcepub fn stack(&mut self, piece: Piece, color: Color) -> Result<(), StackError>
pub fn stack(&mut self, piece: Piece, color: Color) -> Result<(), StackError>
Try to put a piece on top of this stack.
§Errors
You cannot stack on top of capstones or walls with the exception that capstones can flatten walls.
Trait Implementations§
Source§impl Ord for Stack
impl Ord for Stack
Source§impl PartialOrd for Stack
impl PartialOrd for Stack
impl Copy for Stack
impl Eq for Stack
impl StructuralPartialEq for Stack
Auto Trait Implementations§
impl Freeze for Stack
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnwindSafe for Stack
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