[][src]Struct klondike_lib::model::area_list::AreaList

pub struct AreaList { /* fields omitted */ }

A list of areas with one selected and the rest unselected that can efficiently move the selection and map area ids to areas.

Our implementation uses a zipper data structure. The selected_area is the zipper head, and the before_areas and after_areas lists function as stacks; we pop areas back and forth to move the selection back and forth.

Implementations

impl AreaList[src]

pub fn new<T, I>(areas: T) -> Result<AreaList> where
    T: IntoIterator<Item = Box<dyn UnselectedArea>, IntoIter = I>,
    I: Iterator<Item = Box<dyn UnselectedArea>>, 
[src]

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

pub fn get_by_index(&self, index: usize) -> Result<&dyn Area>[src]

pub fn get_by_index_mut(&mut self, index: usize) -> Result<&mut dyn Area>[src]

pub fn get_by_area_id(&self, area_id: AreaId) -> Result<&dyn Area>[src]

pub fn get_by_area_id_mut(&mut self, area_id: AreaId) -> Result<&mut dyn Area>[src]

pub fn selected(&self) -> &dyn SelectedArea[src]

pub fn selected_mut(&mut self) -> &mut dyn SelectedArea[src]

pub fn area_ids(&self) -> Vec<AreaId>[src]

pub fn iter<'b>(&'b self) -> impl Iterator<Item = &'b dyn Area> + 'b[src]

pub fn iter_left_from_selection<'b>(
    &'b self
) -> impl Iterator<Item = &'b dyn Area> + 'b
[src]

pub fn iter_right_from_selection<'b>(
    &'b self
) -> impl Iterator<Item = &'b dyn Area> + 'b
[src]

pub fn move_selection(&mut self, target_area_id: AreaId) -> Result<Vec<AreaId>>[src]

pub fn activate_selected(&mut self) -> Result<Vec<AreaId>>[src]

pub fn return_held(&mut self) -> Result<Vec<AreaId>>[src]

pub fn select_more(&mut self) -> Result<Vec<AreaId>>[src]

pub fn select_less(&mut self) -> Result<Vec<AreaId>>[src]

Trait Implementations

impl Debug for AreaList[src]

Auto Trait Implementations

impl !RefUnwindSafe for AreaList

impl !Send for AreaList

impl !Sync for AreaList

impl Unpin for AreaList

impl !UnwindSafe for AreaList

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,