mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
draft redirection referrer feature
This commit is contained in:
parent
4665a7ff6a
commit
86a6ad058a
7 changed files with 135 additions and 49 deletions
|
|
@ -1,9 +1,13 @@
|
|||
pub mod feature;
|
||||
pub use feature::Feature;
|
||||
|
||||
use gtk::{gio::Cancellable, glib::Priority};
|
||||
use gtk::{
|
||||
gio::Cancellable,
|
||||
glib::{Priority, Uri},
|
||||
};
|
||||
|
||||
/// Request data wrapper for `Client`
|
||||
#[derive(Clone)]
|
||||
pub struct Request {
|
||||
pub feature: Feature,
|
||||
/// Requests chain in order to process redirection rules
|
||||
|
|
@ -25,4 +29,17 @@ impl Request {
|
|||
referrer: referrer.unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
/// Copy `Self` to new `referrer` vector
|
||||
pub fn to_referrer(&self) -> Vec<Request> {
|
||||
let mut referrer = self.referrer.to_vec();
|
||||
referrer.push(self.clone());
|
||||
referrer
|
||||
}
|
||||
|
||||
pub fn uri(&self) -> Option<&Uri> {
|
||||
self.feature.uri()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue