File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ use modrinth_api:: structs:: search:: { ExtendedSearch , Sort } ;
2+ use modrinth_api:: { Error , ModrinthAPI } ;
3+
4+ #[ tokio:: main]
5+ async fn main ( ) -> Result < ( ) , Error > {
6+ let api = ModrinthAPI :: default ( ) ;
7+ let result = api
8+ . extended_search (
9+ "xaeros" , // Query
10+ & Sort :: Downloads , // Sort
11+ Some ( 20 ) , // Maximum number of results to return.
12+ Some ( ExtendedSearch {
13+ offset : None , // The offset into the search. Skips this number of results
14+ facets : vec ! [ ] , // Facets are an essential concept for understanding how to filter out results.
15+ } ) ,
16+ )
17+ . await ?;
18+
19+ println ! ( "{:#?}" , result) ;
20+ Ok ( ( ) )
21+ }
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ mod tests {
120120 async fn search_project ( ) -> Result < ( ) > {
121121 let api = ModrinthAPI :: default ( ) ;
122122 let response = api
123- . extended_search (
123+ . search (
124124 "xaeros" ,
125125 & Sort :: Downloads ,
126126 None ,
@@ -143,7 +143,7 @@ mod tests {
143143 async fn test_fetching_project_with_mut ( ) -> Result < ( ) > {
144144 let api = ModrinthAPI :: default ( ) ;
145145 let response = api
146- . extended_search (
146+ . search (
147147 "xaeros" ,
148148 & Sort :: Downloads ,
149149 None ,
@@ -170,7 +170,7 @@ mod tests {
170170 async fn test_fetching_project_without_mut ( ) -> Result < ( ) > {
171171 let api = ModrinthAPI :: default ( ) ;
172172 let response = api
173- . extended_search (
173+ . search (
174174 "xaeros" ,
175175 & Sort :: Downloads ,
176176 None ,
You can’t perform that action at this time.
0 commit comments