-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69d6ef0
commit b8f31db
Showing
15 changed files
with
621 additions
and
87 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
use std::{ | ||
collections::HashSet, | ||
error::Error, | ||
future::IntoFuture, | ||
sync::Arc, | ||
time::{Duration, Instant}, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Deserialize, Serialize)] | ||
pub enum Kind { | ||
#[serde(rename = "imgs")] | ||
Images, | ||
#[serde(rename = "vids")] | ||
Videos, | ||
#[serde(rename = "news")] | ||
News, | ||
#[serde(rename = "maps")] | ||
Maps, | ||
#[serde(rename = "docs")] | ||
Documentation, | ||
#[serde(rename = "pprs")] | ||
Papers, | ||
#[serde(other)] | ||
General, | ||
} | ||
impl Default for Kind { | ||
fn default() -> Self { | ||
Self::General | ||
} | ||
} | ||
|
||
#[derive(Debug, Default, Deserialize, Serialize)] | ||
pub struct Query { | ||
#[serde(rename = "q")] | ||
pub query: String, | ||
#[serde(rename = "k")] | ||
pub kind: Kind, | ||
#[serde(rename = "p")] | ||
pub page: usize, | ||
} | ||
|
||
#[derive(Debug, Default, Deserialize, Serialize)] | ||
pub struct Result { | ||
pub url: String, | ||
pub title: String, | ||
pub general: Option<GeneralResult>, | ||
pub forum: Option<ForumResult>, | ||
pub image: Option<ImageResult>, | ||
} | ||
|
||
#[derive(Debug, Default, Deserialize, Serialize)] | ||
pub struct GeneralResult { | ||
pub snippet: String, | ||
} | ||
#[derive(Debug, Default, Deserialize, Serialize)] | ||
pub struct ForumResult { | ||
pub poster_image: Option<String>, | ||
pub poster_username: String, | ||
pub poster_url: Option<String>, | ||
pub tags: Option<Vec<String>>, | ||
} | ||
#[derive(Debug, Default, Deserialize, Serialize)] | ||
pub struct ImageResult {} |
Oops, something went wrong.