pub struct Zipper<Id, S> {
pub node: Node<Id, S>,
pub parent: Option<Box<Zipper<Id, S>>>,
/* private fields */
}Expand description
Example of a Zipper cursor traversing a Vec,
the focus provides a view “Up” and “Down” the data:
[1, 2, 3, 4, 5] // array with 5 entries
1}[2, 3, 4, 5] // zipper starts with focues at first index
[1] 2}[3, 4, 5] // moving down the array
[2, 1] 3}[4, 5]
[3, 2, 1] 4}[5]
[4, 3, 2, 1]{5 // zipper travels back up the arraySee node/README.md for further details.
Fields§
§node: Node<Id, S>§parent: Option<Box<Zipper<Id, S>>>Implementations§
Auto Trait Implementations§
impl<Id, S> Freeze for Zipper<Id, S>
impl<Id, S> RefUnwindSafe for Zipper<Id, S>where
Id: RefUnwindSafe,
S: RefUnwindSafe,
impl<Id, S> Send for Zipper<Id, S>
impl<Id, S> Sync for Zipper<Id, S>
impl<Id, S> Unpin for Zipper<Id, S>
impl<Id, S> UnwindSafe for Zipper<Id, S>where
Id: UnwindSafe,
S: UnwindSafe,
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