Struct advent_of_code_2022::day_5::SupplyStacks
source · struct SupplyStacks {
stacks: Vec<VecDeque<char>>,
}
Expand description
Represents the current state of the set of stacks being moved.
Fields§
§stacks: Vec<VecDeque<char>>
Implementations§
source§impl SupplyStacks
impl SupplyStacks
sourcefn do_move(
&mut self,
(count, from, to): (usize, usize, usize),
all_at_once: bool
)
fn do_move( &mut self, (count, from, to): (usize, usize, usize), all_at_once: bool )
Apply a single move of crates - either one by one, or all at once
sourcefn do_moves(&mut self, mvs: &Vec<(usize, usize, usize)>, all_at_once: bool)
fn do_moves(&mut self, mvs: &Vec<(usize, usize, usize)>, all_at_once: bool)
Apply a list of moves delegating each move to SupplyStacks::do_move
sourcefn get_top_crates(&self) -> String
fn get_top_crates(&self) -> String
Combine the characters at the top of each stack into a string used as the puzzle output.
Trait Implementations§
source§impl Clone for SupplyStacks
impl Clone for SupplyStacks
source§fn clone(&self) -> SupplyStacks
fn clone(&self) -> SupplyStacks
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 Debug for SupplyStacks
impl Debug for SupplyStacks
source§impl From<&str> for SupplyStacks
impl From<&str> for SupplyStacks
source§impl PartialEq<SupplyStacks> for SupplyStacks
impl PartialEq<SupplyStacks> for SupplyStacks
source§fn eq(&self, other: &SupplyStacks) -> bool
fn eq(&self, other: &SupplyStacks) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SupplyStacks
impl StructuralEq for SupplyStacks
impl StructuralPartialEq for SupplyStacks
Auto Trait Implementations§
impl RefUnwindSafe for SupplyStacks
impl Send for SupplyStacks
impl Sync for SupplyStacks
impl Unpin for SupplyStacks
impl UnwindSafe for SupplyStacks
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