mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
implement search request handler
This commit is contained in:
parent
3f4efee60b
commit
e669034452
3 changed files with 42 additions and 5 deletions
|
|
@ -1,9 +1,10 @@
|
|||
mod error;
|
||||
mod feature;
|
||||
mod gemini;
|
||||
mod search;
|
||||
|
||||
use super::{Client, Response};
|
||||
use error::Error;
|
||||
pub use error::Error;
|
||||
use feature::Feature;
|
||||
use gtk::{
|
||||
gio::Cancellable,
|
||||
|
|
@ -47,7 +48,7 @@ impl Request {
|
|||
feature: feature.unwrap_or_default(),
|
||||
referrer: referrer.map(Box::new),
|
||||
uri,
|
||||
}),
|
||||
}), // @TODO validate request len by constructor
|
||||
"titan" => Ok(Self::Titan {
|
||||
referrer: referrer.map(Box::new),
|
||||
uri,
|
||||
|
|
@ -105,3 +106,14 @@ impl Request {
|
|||
1 + count
|
||||
}
|
||||
}
|
||||
|
||||
// Tools
|
||||
|
||||
/// Create new search `Request`
|
||||
/// @TODO
|
||||
// * implement DNS lookup before apply this option
|
||||
// * make search provider optional
|
||||
// * validate request len by gemini specifications
|
||||
pub fn search(query: &str) -> Request {
|
||||
Request::from_uri(search::tgls(query), None, None).unwrap() // no handler as unexpected
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue