mirror of
https://github.com/Myzel394/tifsep.git
synced 2025-06-18 15:35:26 +02:00
23 lines
517 B
Rust
23 lines
517 B
Rust
pub mod engine_base {
|
|
use async_trait::async_trait;
|
|
|
|
#[derive(Clone, Copy, Debug, Hash)]
|
|
pub enum SearchEngine {
|
|
DuckDuckGo,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Hash)]
|
|
pub struct SearchResult {
|
|
pub title: String,
|
|
pub url: String,
|
|
pub description: String,
|
|
pub engine: SearchEngine,
|
|
}
|
|
|
|
#[async_trait]
|
|
pub trait EngineBase {
|
|
fn parse_packet<'a>(&mut self, packet: impl Iterator<Item = &'a u8>);
|
|
fn search(&mut self, query: &str);
|
|
}
|
|
}
|