reorganize client Request

This commit is contained in:
yggverse 2025-01-18 05:35:39 +02:00
parent 9d690d3137
commit 4665a7ff6a
9 changed files with 164 additions and 115 deletions

View file

@ -0,0 +1,28 @@
pub mod feature;
pub use feature::Feature;
use gtk::{gio::Cancellable, glib::Priority};
/// Request data wrapper for `Client`
pub struct Request {
pub feature: Feature,
/// Requests chain in order to process redirection rules
pub referrer: Vec<Request>,
}
impl Request {
// Constructors
/// Build new `Self`
pub fn build(
query: &str,
referrer: Option<Vec<Request>>,
cancellable: Cancellable,
priority: Priority,
) -> Self {
Self {
feature: Feature::build(query, cancellable, priority),
referrer: referrer.unwrap_or_default(),
}
}
}