Struct adapton::collection::ListZipper [] [src]

pub struct ListZipper<A: Adapton, X, L: ListT<A, X>> {
    pub left: L::List,
    pub right: L::List,
}

Lists with a focus; suitable to implement ListEdit.

Fields

left: L::List

Elements to the left of the focus, nearest to furthest.

right: L::List

Elements to the right of the focus, nearest to furthest.

Trait Implementations

impl<A: Clone + Adapton, X: Clone, L: Clone + ListT<A, X>> Clone for ListZipper<A, X, L> where L::List: Clone
[src]

fn clone(&self) -> ListZipper<A, X, L>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<A: Eq + Adapton, X: Eq, L: Eq + ListT<A, X>> Eq for ListZipper<A, X, L> where L::List: Eq
[src]

impl<A: PartialEq + Adapton, X: PartialEq, L: PartialEq + ListT<A, X>> PartialEq for ListZipper<A, X, L> where L::List: PartialEq
[src]

fn eq(&self, __arg_0: &ListZipper<A, X, L>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &ListZipper<A, X, L>) -> bool

This method tests for !=.

impl<A: Hash + Adapton, X: Hash, L: Hash + ListT<A, X>> Hash for ListZipper<A, X, L> where L::List: Hash
[src]

fn hash<__HAXL: Hasher>(&self, __arg_0: &mut __HAXL)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl<A: Debug + Adapton, X: Debug, L: Debug + ListT<A, X>> Debug for ListZipper<A, X, L> where L::List: Debug
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<A: Adapton, X: Debug + Hash + PartialEq + Eq + Clone, L: ListT<A, X>> ListEdit<A, X> for ListZipper<A, X, L>
[src]

Implement ListEdit for ListZipper generically with respect to adapton implementation A, list element type X, and list implementation L.

type State = ListZipper<A, X, L>

The State of the Editor is abstract.

type Dir = Dir2

Lists with foci admit two directions for movement.

fn clr_names(st: &mut A, zip: Self::State, dir: Self::Dir) -> Self::State

fn ins_name(st: &mut A, zip: Self::State, dir: Self::Dir, name: A::Name) -> Self::State

fn ins_cell(st: &mut A, zip: Self::State, dir: Self::Dir, name: A::Name) -> Self::State

fn rem_name(st: &mut A, zip: Self::State, dir: Self::Dir) -> (Self::State, Option<A::Name>)

fn empty(st: &mut A) -> Self::State

fn insert(st: &mut A, zip: Self::State, dir: Self::Dir, x: X) -> Self::State

fn remove(st: &mut A, zip: Self::State, dir: Self::Dir) -> (Self::State, Option<X>)

fn goto(st: &mut A, zip: Self::State, dir: Self::Dir) -> (Self::State, bool)

fn observe(st: &mut A, zip: Self::State, dir: Self::Dir) -> (Self::State, Option<X>)

fn replace(st: &mut A, zip: Self::State, dir: Self::Dir, y: X) -> (Self::State, X, bool)

fn get_list<N: ListT<A, X>, T: TreeT<A, X>>(st: &mut A, zip: Self::State, dir: Self::Dir) -> N::List

fn get_tree<T: TreeT<A, X>>(st: &mut A, zip: Self::State, dir: Self::Dir) -> T::Tree

Creates a tree whose leaves hold the contents of the zipper, in order. When dir=Left, the tree's leaves are ordered from left-to-right, i.e., as (rev left) @ right. When dir=Right, the tree's leaves are ordered from right-to-left, i.e., as (rev right) @ left.