diff --git a/src/experimental/zipper_algebra.rs b/src/experimental/zipper_algebra.rs index 8faa16e..844d97c 100644 --- a/src/experimental/zipper_algebra.rs +++ b/src/experimental/zipper_algebra.rs @@ -98,6 +98,16 @@ impl ZipperAlgebraExt { } +impl ZipperAlgebraExt + for ReadZipperOwned +{ +} + +impl ZipperAlgebraExt for PrefixZipper<'_, Z> where + Z: ZipperInfallibleSubtries + ZipperSubtries + ZipperConcrete + ZipperMoving +{ +} + /// Performs an ordered join (least upper bound) of two radix-256 tries using zipper traversal. /// /// This function merges two tries by simultaneously traversing them in lexicographic order, @@ -1475,7 +1485,7 @@ impl MergePolicy for Join { Z: ZipperInfallibleSubtries + ZipperMoving, Out: ZipperWriting, { - out.graft_children(z, range); + out.graft_masked_branches(z, range, false) } #[inline] @@ -1490,7 +1500,7 @@ impl MergePolicy for Join { Z: ZipperInfallibleSubtries + ZipperConcrete + ZipperMoving, Out: ZipperWriting, { - out.graft_children(z, ByteMask::FULL); + out.graft_masked_branches(z, ByteMask::FULL, false) } } @@ -1565,7 +1575,7 @@ impl MergePolicy for Meet { Z: ZipperInfallibleSubtries + ZipperConcrete + ZipperMoving, Out: ZipperWriting, { - out.graft_children(z, ByteMask::FULL); + out.graft_masked_branches(z, ByteMask::FULL, false); } } @@ -1640,7 +1650,7 @@ impl MergePolicy for Subtract { Z: ZipperInfallibleSubtries + ZipperMoving, Out: ZipperWriting, { - out.graft_children(z, range); + out.graft_masked_branches(z, range, false); } #[inline] @@ -1660,7 +1670,7 @@ impl MergePolicy for Subtract { Out: ZipperWriting, { if mask == 1 { - out.graft_children(z, range); + out.graft_masked_branches(z, range, false) } } @@ -1760,6 +1770,8 @@ mod zipper_algebra_poly { pub(super) enum SomeMutRefZ<'a, 'trie, 'path, V: Clone + Send + Sync + Unpin, A: Allocator> { RZ(&'a mut ReadZipperUntracked<'trie, 'path, V, A>), RZT(&'a mut ReadZipperTracked<'trie, 'path, V, A>), + PZRZ(&'a mut PrefixZipper<'a, ReadZipperUntracked<'trie, 'path, V, A>>), + PZRZT(&'a mut PrefixZipper<'a, ReadZipperTracked<'trie, 'path, V, A>>), } impl ZipperInfallibleSubtries @@ -1769,6 +1781,8 @@ mod zipper_algebra_poly { match self { SomeMutRefZ::RZ(inner) => inner.make_map(), SomeMutRefZ::RZT(inner) => inner.make_map(), + SomeMutRefZ::PZRZ(inner) => inner.make_map(), + SomeMutRefZ::PZRZT(inner) => inner.make_map(), } } @@ -1776,6 +1790,8 @@ mod zipper_algebra_poly { match self { SomeMutRefZ::RZ(inner) => inner.get_trie_ref(), SomeMutRefZ::RZT(inner) => inner.get_trie_ref(), + SomeMutRefZ::PZRZ(inner) => inner.get_trie_ref(), + SomeMutRefZ::PZRZT(inner) => inner.get_trie_ref(), } } @@ -1783,6 +1799,8 @@ mod zipper_algebra_poly { match self { SomeMutRefZ::RZ(inner) => inner.get_focus(), SomeMutRefZ::RZT(inner) => inner.get_focus(), + SomeMutRefZ::PZRZ(inner) => inner.get_focus(), + SomeMutRefZ::PZRZT(inner) => inner.get_focus(), } } @@ -1790,6 +1808,8 @@ mod zipper_algebra_poly { match self { SomeMutRefZ::RZ(inner) => inner.get_focus_at(path), SomeMutRefZ::RZT(inner) => inner.get_focus_at(path), + SomeMutRefZ::PZRZ(inner) => inner.get_focus_at(path), + SomeMutRefZ::PZRZT(inner) => inner.get_focus_at(path), } } @@ -1797,6 +1817,8 @@ mod zipper_algebra_poly { match self { SomeMutRefZ::RZ(inner) => inner.try_borrow_focus(), SomeMutRefZ::RZT(inner) => inner.try_borrow_focus(), + SomeMutRefZ::PZRZ(inner) => inner.try_borrow_focus(), + SomeMutRefZ::PZRZT(inner) => inner.try_borrow_focus(), } } } diff --git a/src/write_zipper.rs b/src/write_zipper.rs index dbc48df..a596adc 100644 --- a/src/write_zipper.rs +++ b/src/write_zipper.rs @@ -139,12 +139,6 @@ pub trait ZipperWriting: Wri } } - /// Deprecated alias for [graft_masked_branches](ZipperWriting::graft_masked_branches) - #[deprecated] - fn graft_children>(&mut self, src: &Z, child_mask: ByteMask) { - self.graft_masked_branches(src, child_mask, false) - } - /// Joins (union of) the subtrie below the focus of `read_zipper` into the subtrie downstream from the /// focus of `self` ///