Struct adapton::collection_edit::ListZipper
[−]
[src]
pub struct ListZipper<A: Adapton, X, T: TreeT<A, X>, L: TreeListT<A, X, T>> { pub left: L::List, pub right: L::List, // some fields omitted }
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, T: Clone + TreeT<A, X>, L: Clone + TreeListT<A, X, T>> Clone for ListZipper<A, X, T, L> where L::List: Clone, T::Tree: Clone
[src]
fn clone(&self) -> ListZipper<A, X, T, 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, T: Eq + TreeT<A, X>, L: Eq + TreeListT<A, X, T>> Eq for ListZipper<A, X, T, L> where L::List: Eq, T::Tree: Eq
[src]
impl<A: PartialEq + Adapton, X: PartialEq, T: PartialEq + TreeT<A, X>, L: PartialEq + TreeListT<A, X, T>> PartialEq for ListZipper<A, X, T, L> where L::List: PartialEq, T::Tree: PartialEq
[src]
fn eq(&self, __arg_0: &ListZipper<A, X, T, 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, T, L>) -> bool
This method tests for !=
.
impl<A: Hash + Adapton, X: Hash, T: Hash + TreeT<A, X>, L: Hash + TreeListT<A, X, T>> Hash for ListZipper<A, X, T, L> where L::List: Hash, T::Tree: Hash
[src]
fn hash<__HAXTL: Hasher>(&self, __arg_0: &mut __HAXTL)
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, T: Debug + TreeT<A, X>, L: Debug + TreeListT<A, X, T>> Debug for ListZipper<A, X, T, L> where L::List: Debug, T::Tree: Debug
[src]
impl<A: Adapton, X: Debug + Hash + PartialEq + Eq + Clone, T: TreeT<A, X>, L: TreeListT<A, X, T>> ListEdit<A, X, T> for ListZipper<A, X, T, 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, T, L>
The State of the Editor is abstract.
fn clr_names(st: &mut A, zip: Self::State, dir: Dir2) -> Self::State
fn ins_tree(st: &mut A, zip: Self::State, ins_dir: Dir2, tree: T::Tree, tree_dir: Dir2) -> Self::State
fn ins_name(st: &mut A, zip: Self::State, dir: Dir2, name: A::Name) -> Self::State
fn ins_cell(st: &mut A, zip: Self::State, dir: Dir2, name: A::Name) -> Self::State
fn rem_name(st: &mut A, zip: Self::State, dir: Dir2) -> (Self::State, Option<A::Name>)
fn empty(st: &mut A) -> Self::State
fn insert(st: &mut A, zip: Self::State, dir: Dir2, x: X) -> Self::State
fn remove(st: &mut A, zip: Self::State, dir: Dir2) -> (Self::State, Option<X>)
fn goto(st: &mut A, zip: Self::State, dir: Dir2) -> (Self::State, bool)
fn observe(st: &mut A, zip: Self::State, dir: Dir2) -> (Self::State, Option<X>)
fn replace(st: &mut A, zip: Self::State, dir: Dir2, y: X) -> (Self::State, X, bool)
fn clear_side(st: &mut A, zip: Self::State, dir: Dir2) -> Self::State
fn get_list<N: ListT<A, X>>(st: &mut A, zip: Self::State, dir: Dir2) -> N::List
fn get_tree(st: &mut A, zip: Self::State, dir: Dir2) -> 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.