[−][src]Struct klondike_lib::model::area_list::AreaList
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]
T: IntoIterator<Item = Box<dyn UnselectedArea>, IntoIter = I>,
I: Iterator<Item = Box<dyn UnselectedArea>>,
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]
&'b self
) -> impl Iterator<Item = &'b dyn Area> + 'b
pub fn iter_right_from_selection<'b>(
&'b self
) -> impl Iterator<Item = &'b dyn Area> + 'b
[src]
&'b self
) -> impl Iterator<Item = &'b dyn Area> + 'b
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,