• Home
  • Raw
  • Download

Lines Matching full:range

11                                   Range as BTreeRange};
16 Range as BTreeRange};
106 pub struct Range<'a, K: 'a, V: 'a>(RangeInner<'a, K, V>); struct
108 impl<'a, K: 'a, V: 'a> Iterator for Range<'a, K, V> { implementation
125 RangeInner::Owned(ref mut range) => range.next(), in next()
130 impl<'a, K: 'a, V: 'a> DoubleEndedIterator for Range<'a, K, V> { implementation
145 RangeInner::Owned(ref mut range) => range.next_back(), in next_back()
150 fn binary_search_by_key_range<'a, K, V, Q: 'a, R>(slice: &[Option<(K, V)>], range: R) -> Result<(us… in binary_search_by_key_range()
169 if let Bound::Unbounded = range.start_bound() { in binary_search_by_key_range()
174 match &range.start_bound() { in binary_search_by_key_range()
200 if let Bound::Unbounded = range.end_bound() { in binary_search_by_key_range()
205 match &range.end_bound() { in binary_search_by_key_range()
298 pub fn range<'b, 'c, Q: 'c, R>(&'b self, range: R) -> Range<'a, K, V> in range() method
303 match binary_search_by_key_range(&pairs[0..self.len()], range) { in range()
304 Ok((begin, end)) => Range(RangeInner::Borrowed { in range()
306 Err(()) => Range(RangeInner::Borrowed { in range()
312 Range(RangeInner::Owned(map.range(range))) in range()
576 let mut range = map.range("a"..); in test_range_full_unbounded() localVariable
577 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full_unbounded()
578 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_unbounded()
579 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_unbounded()
580 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_unbounded()
581 assert_eq!(range.next(), None); in test_range_full_unbounded()
582 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
584 let mut range = map.range("a"..); in test_range_full_unbounded() localVariable
585 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full_unbounded()
586 assert_eq!(range.next_back(), Some((&"d", &4))); in test_range_full_unbounded()
587 assert_eq!(range.next_back(), Some((&"c", &3))); in test_range_full_unbounded()
588 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_unbounded()
589 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
590 assert_eq!(range.next(), None); in test_range_full_unbounded()
592 let mut range = map.range("b"..); in test_range_full_unbounded() localVariable
593 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_unbounded()
594 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_unbounded()
595 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_unbounded()
596 assert_eq!(range.next(), None); in test_range_full_unbounded()
597 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
599 let mut range = map.range("d"..); in test_range_full_unbounded() localVariable
600 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_unbounded()
601 assert_eq!(range.next(), None); in test_range_full_unbounded()
602 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
604 let mut range = map.range(.."e"); in test_range_full_unbounded() localVariable
605 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full_unbounded()
606 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_unbounded()
607 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_unbounded()
608 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_unbounded()
609 assert_eq!(range.next(), None); in test_range_full_unbounded()
610 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
612 let mut range = map.range(.."d"); in test_range_full_unbounded() localVariable
613 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full_unbounded()
614 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_unbounded()
615 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_unbounded()
616 assert_eq!(range.next(), None); in test_range_full_unbounded()
617 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
619 let mut range = map.range(.."b"); in test_range_full_unbounded() localVariable
620 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full_unbounded()
621 assert_eq!(range.next(), None); in test_range_full_unbounded()
622 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
624 let mut range = map.range(.."a"); in test_range_full_unbounded() localVariable
625 assert_eq!(range.next(), None); in test_range_full_unbounded()
626 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
628 let mut range = map.range::<&str, _>(..); in test_range_full_unbounded() localVariable
629 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full_unbounded()
630 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_unbounded()
631 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_unbounded()
632 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_unbounded()
633 assert_eq!(range.next(), None); in test_range_full_unbounded()
634 assert_eq!(range.next_back(), None); in test_range_full_unbounded()
643 let mut range = map.range::<&str, _>((Excluded("a"), Excluded("a"))); in test_range_full_exclude_left() localVariable
644 assert_eq!(range.next(), None); in test_range_full_exclude_left()
645 let mut range = map.range::<&str, _>((Excluded("a"), Excluded("b"))); in test_range_full_exclude_left() localVariable
646 assert_eq!(range.next(), None); in test_range_full_exclude_left()
647 let mut range = map.range::<&str, _>((Excluded("a"), Excluded("c"))); in test_range_full_exclude_left() localVariable
648 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_exclude_left()
649 assert_eq!(range.next(), None); in test_range_full_exclude_left()
650 let mut range = map.range::<&str, _>((Excluded("a"), Excluded("d"))); in test_range_full_exclude_left() localVariable
651 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_exclude_left()
652 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_exclude_left()
653 assert_eq!(range.next(), None); in test_range_full_exclude_left()
654 let mut range = map.range::<&str, _>((Excluded("a"), Excluded("e"))); in test_range_full_exclude_left() localVariable
655 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_exclude_left()
656 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_exclude_left()
657 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_exclude_left()
658 assert_eq!(range.next(), None); in test_range_full_exclude_left()
667 let mut range = map.range::<&str, _>((Included("b"), Included("a"))); in test_range_full_include_right() localVariable
668 assert_eq!(range.next(), None); in test_range_full_include_right()
669 let mut range = map.range::<&str, _>((Included("b"), Included("b"))); in test_range_full_include_right() localVariable
670 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_include_right()
671 assert_eq!(range.next(), None); in test_range_full_include_right()
672 let mut range = map.range::<&str, _>((Included("b"), Included("c"))); in test_range_full_include_right() localVariable
673 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_include_right()
674 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_include_right()
675 assert_eq!(range.next(), None); in test_range_full_include_right()
676 let mut range = map.range::<&str, _>((Included("b"), Included("d"))); in test_range_full_include_right() localVariable
677 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_include_right()
678 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_include_right()
679 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_include_right()
680 assert_eq!(range.next(), None); in test_range_full_include_right()
681 let mut range = map.range::<&str, _>((Included("b"), Included("e"))); in test_range_full_include_right() localVariable
682 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full_include_right()
683 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full_include_right()
684 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full_include_right()
685 assert_eq!(range.next(), None); in test_range_full_include_right()
687 let mut range = map.range::<&str, _>((Included("b"), Included("a"))); in test_range_full_include_right() localVariable
688 assert_eq!(range.next_back(), None); in test_range_full_include_right()
689 let mut range = map.range::<&str, _>((Included("b"), Included("b"))); in test_range_full_include_right() localVariable
690 assert_eq!(range.next_back(), Some((&"b", &2))); in test_range_full_include_right()
691 assert_eq!(range.next_back(), None); in test_range_full_include_right()
692 let mut range = map.range::<&str, _>((Included("b"), Included("c"))); in test_range_full_include_right() localVariable
693 assert_eq!(range.next_back(), Some((&"c", &3))); in test_range_full_include_right()
694 assert_eq!(range.next_back(), Some((&"b", &2))); in test_range_full_include_right()
695 assert_eq!(range.next_back(), None); in test_range_full_include_right()
696 let mut range = map.range::<&str, _>((Included("b"), Included("d"))); in test_range_full_include_right() localVariable
697 assert_eq!(range.next_back(), Some((&"d", &4))); in test_range_full_include_right()
698 assert_eq!(range.next_back(), Some((&"c", &3))); in test_range_full_include_right()
699 assert_eq!(range.next_back(), Some((&"b", &2))); in test_range_full_include_right()
700 assert_eq!(range.next_back(), None); in test_range_full_include_right()
701 let mut range = map.range::<&str, _>((Included("b"), Included("e"))); in test_range_full_include_right() localVariable
702 assert_eq!(range.next_back(), Some((&"d", &4))); in test_range_full_include_right()
703 assert_eq!(range.next_back(), Some((&"c", &3))); in test_range_full_include_right()
704 assert_eq!(range.next_back(), Some((&"b", &2))); in test_range_full_include_right()
705 assert_eq!(range.next_back(), None); in test_range_full_include_right()
714 let mut range = map.range("0".."a"); in test_range_full() localVariable
715 assert_eq!(range.next(), None); in test_range_full()
716 let mut range = map.range("0".."b"); in test_range_full() localVariable
717 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
718 assert_eq!(range.next(), None); in test_range_full()
719 let mut range = map.range("0".."c"); in test_range_full() localVariable
720 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
721 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
722 assert_eq!(range.next(), None); in test_range_full()
723 let mut range = map.range("0".."d"); in test_range_full() localVariable
724 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
725 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
726 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
727 assert_eq!(range.next(), None); in test_range_full()
728 let mut range = map.range("0".."e"); in test_range_full() localVariable
729 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
730 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
731 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
732 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full()
733 assert_eq!(range.next(), None); in test_range_full()
735 let mut range = map.range("a".."a"); in test_range_full() localVariable
736 assert_eq!(range.next(), None); in test_range_full()
737 let mut range = map.range("a".."b"); in test_range_full() localVariable
738 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
739 assert_eq!(range.next(), None); in test_range_full()
740 let mut range = map.range("a".."c"); in test_range_full() localVariable
741 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
742 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
743 assert_eq!(range.next(), None); in test_range_full()
744 let mut range = map.range("a".."d"); in test_range_full() localVariable
745 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
746 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
747 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
748 assert_eq!(range.next(), None); in test_range_full()
749 let mut range = map.range("a".."e"); in test_range_full() localVariable
750 assert_eq!(range.next(), Some((&"a", &1))); in test_range_full()
751 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
752 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
753 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full()
754 assert_eq!(range.next(), None); in test_range_full()
756 let mut range = map.range("b".."a"); in test_range_full() localVariable
757 assert_eq!(range.next(), None); in test_range_full()
758 let mut range = map.range("b".."b"); in test_range_full() localVariable
759 assert_eq!(range.next(), None); in test_range_full()
760 let mut range = map.range("b".."c"); in test_range_full() localVariable
761 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
762 assert_eq!(range.next(), None); in test_range_full()
763 let mut range = map.range("b".."d"); in test_range_full() localVariable
764 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
765 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
766 assert_eq!(range.next(), None); in test_range_full()
767 let mut range = map.range("b".."e"); in test_range_full() localVariable
768 assert_eq!(range.next(), Some((&"b", &2))); in test_range_full()
769 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
770 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full()
771 assert_eq!(range.next(), None); in test_range_full()
773 let mut range = map.range("c".."a"); in test_range_full() localVariable
774 assert_eq!(range.next(), None); in test_range_full()
775 let mut range = map.range("c".."b"); in test_range_full() localVariable
776 assert_eq!(range.next(), None); in test_range_full()
777 let mut range = map.range("c".."c"); in test_range_full() localVariable
778 assert_eq!(range.next(), None); in test_range_full()
779 let mut range = map.range("c".."d"); in test_range_full() localVariable
780 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
781 assert_eq!(range.next(), None); in test_range_full()
782 let mut range = map.range("c".."e"); in test_range_full() localVariable
783 assert_eq!(range.next(), Some((&"c", &3))); in test_range_full()
784 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full()
785 assert_eq!(range.next(), None); in test_range_full()
787 let mut range = map.range("d".."a"); in test_range_full() localVariable
788 assert_eq!(range.next(), None); in test_range_full()
789 let mut range = map.range("d".."b"); in test_range_full() localVariable
790 assert_eq!(range.next(), None); in test_range_full()
791 let mut range = map.range("d".."c"); in test_range_full() localVariable
792 assert_eq!(range.next(), None); in test_range_full()
793 let mut range = map.range("d".."d"); in test_range_full() localVariable
794 assert_eq!(range.next(), None); in test_range_full()
795 let mut range = map.range("d".."e"); in test_range_full() localVariable
796 assert_eq!(range.next(), Some((&"d", &4))); in test_range_full()
797 assert_eq!(range.next(), None); in test_range_full()
799 let mut range = map.range("e".."a"); in test_range_full() localVariable
800 assert_eq!(range.next(), None); in test_range_full()
801 let mut range = map.range("e".."b"); in test_range_full() localVariable
802 assert_eq!(range.next(), None); in test_range_full()
803 let mut range = map.range("e".."c"); in test_range_full() localVariable
804 assert_eq!(range.next(), None); in test_range_full()
805 let mut range = map.range("e".."d"); in test_range_full() localVariable
806 assert_eq!(range.next(), None); in test_range_full()
807 let mut range = map.range("e".."e"); in test_range_full() localVariable
808 assert_eq!(range.next(), None); in test_range_full()
817 let mut range = map.range("0".."a"); in test_range_one_pair() localVariable
818 assert_eq!(range.next(), None); in test_range_one_pair()
819 let mut range = map.range("0".."b"); in test_range_one_pair() localVariable
820 assert_eq!(range.next(), Some((&"a", &1))); in test_range_one_pair()
821 assert_eq!(range.next(), None); in test_range_one_pair()
822 let mut range = map.range("0".."c"); in test_range_one_pair() localVariable
823 assert_eq!(range.next(), Some((&"a", &1))); in test_range_one_pair()
824 assert_eq!(range.next(), None); in test_range_one_pair()
826 let mut range = map.range("a".."a"); in test_range_one_pair() localVariable
827 assert_eq!(range.next(), None); in test_range_one_pair()
828 let mut range = map.range("a".."b"); in test_range_one_pair() localVariable
829 assert_eq!(range.next(), Some((&"a", &1))); in test_range_one_pair()
830 assert_eq!(range.next(), None); in test_range_one_pair()
831 let mut range = map.range("a".."c"); in test_range_one_pair() localVariable
832 assert_eq!(range.next(), Some((&"a", &1))); in test_range_one_pair()
833 assert_eq!(range.next(), None); in test_range_one_pair()
835 let mut range = map.range("b".."a"); in test_range_one_pair() localVariable
836 assert_eq!(range.next(), None); in test_range_one_pair()
837 let mut range = map.range("b".."b"); in test_range_one_pair() localVariable
838 assert_eq!(range.next(), None); in test_range_one_pair()
839 let mut range = map.range("b".."c"); in test_range_one_pair() localVariable
840 assert_eq!(range.next(), None); in test_range_one_pair()
849 let mut range = map.range("b".."a"); in test_range_empty() localVariable
850 assert_eq!(range.next(), None); in test_range_empty()
851 let mut range = map.range("b".."b"); in test_range_empty() localVariable
852 assert_eq!(range.next(), None); in test_range_empty()
853 let mut range = map.range("b".."c"); in test_range_empty() localVariable
854 assert_eq!(range.next(), None); in test_range_empty()