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