APIs for links and references in the ATmosphere

fixes at-microcosm/links#24 updated assertions and make check passes all tests

Changed files
+18
constellation
src
storage
+18
constellation/src/storage/mod.rs
··· 150 150 version: (0, 0), 151 151 items: vec![], 152 152 next: None, 153 + total: 0, 153 154 } 154 155 ); 155 156 assert_eq!( ··· 158 159 version: (0, 0), 159 160 items: vec![], 160 161 next: None, 162 + total: 0, 161 163 } 162 164 ); 163 165 assert_eq!(storage.get_all_counts("bad-example.com")?, HashMap::new()); ··· 648 650 rkey: "asdf".into(), 649 651 }], 650 652 next: None, 653 + total: 1, 651 654 } 652 655 ); 653 656 assert_eq!( ··· 656 659 version: (1, 0), 657 660 items: vec!["did:plc:asdf".into()], 658 661 next: None, 662 + total: 1, 659 663 } 660 664 ); 661 665 assert_stats(storage.get_stats()?, 1..=1, 1..=1, 1..=1); ··· 697 701 }, 698 702 ], 699 703 next: Some(3), 704 + total: 5, 700 705 } 701 706 ); 702 707 assert_eq!( ··· 705 710 version: (5, 0), 706 711 items: vec!["did:plc:asdf-5".into(), "did:plc:asdf-4".into()], 707 712 next: Some(3), 713 + total: 5, 708 714 } 709 715 ); 710 716 let links = storage.get_links("a.com", "app.t.c", ".abc.uri", 2, links.next)?; ··· 726 732 }, 727 733 ], 728 734 next: Some(1), 735 + total: 5, 729 736 } 730 737 ); 731 738 assert_eq!( ··· 734 741 version: (5, 0), 735 742 items: vec!["did:plc:asdf-3".into(), "did:plc:asdf-2".into()], 736 743 next: Some(1), 744 + total: 5, 737 745 } 738 746 ); 739 747 let links = storage.get_links("a.com", "app.t.c", ".abc.uri", 2, links.next)?; ··· 748 756 rkey: "asdf".into(), 749 757 },], 750 758 next: None, 759 + total: 5, 751 760 } 752 761 ); 753 762 assert_eq!( ··· 756 765 version: (5, 0), 757 766 items: vec!["did:plc:asdf-1".into()], 758 767 next: None, 768 + total: 5, 759 769 } 760 770 ); 761 771 assert_stats(storage.get_stats()?, 5..=5, 1..=1, 5..=5); ··· 796 806 }, 797 807 ], 798 808 next: Some(2), 809 + total: 4, 799 810 } 800 811 ); 801 812 let links = storage.get_links("a.com", "app.t.c", ".abc.uri", 2, links.next)?; ··· 816 827 }, 817 828 ], 818 829 next: None, 830 + total: 4, 819 831 } 820 832 ); 821 833 assert_stats(storage.get_stats()?, 4..=4, 1..=1, 4..=4); ··· 856 868 }, 857 869 ], 858 870 next: Some(2), 871 + total: 4, 859 872 } 860 873 ); 861 874 storage.push( ··· 890 903 }, 891 904 ], 892 905 next: None, 906 + total: 5, 893 907 } 894 908 ); 895 909 assert_stats(storage.get_stats()?, 5..=5, 1..=1, 5..=5); ··· 930 944 }, 931 945 ], 932 946 next: Some(2), 947 + total: 4, 933 948 } 934 949 ); 935 950 storage.push( ··· 951 966 rkey: "asdf".into(), 952 967 },], 953 968 next: None, 969 + total: 3, 954 970 } 955 971 ); 956 972 assert_stats(storage.get_stats()?, 4..=4, 1..=1, 3..=3); ··· 991 1007 }, 992 1008 ], 993 1009 next: Some(2), 1010 + total: 4, 994 1011 } 995 1012 ); 996 1013 storage.push( ··· 1008 1025 rkey: "asdf".into(), 1009 1026 },], 1010 1027 next: None, 1028 + total: 4, 1011 1029 } 1012 1030 ); 1013 1031 assert_stats(storage.get_stats()?, 4..=4, 1..=1, 4..=4);