mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-03 01:55:27 +00:00
draft redirection features
This commit is contained in:
parent
aa44325dea
commit
e3a6796627
5 changed files with 320 additions and 133 deletions
40
src/app/browser/window/tab/item/page/meta/redirect.rs
Normal file
40
src/app/browser/window/tab/item/page/meta/redirect.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
use gtk::glib::Uri;
|
||||
|
||||
/// # Redirection data holder
|
||||
///
|
||||
/// This component does nothing,
|
||||
/// but useful as the container for temporary redirection data
|
||||
/// operated by external controller
|
||||
///
|
||||
/// ## Members
|
||||
///
|
||||
/// * `count` - to limit redirect attempts
|
||||
/// * `is_follow` - indicates how to process this redirect exactly
|
||||
/// * `target` - destination address
|
||||
pub struct Redirect {
|
||||
count: i8,
|
||||
is_follow: bool,
|
||||
target: Uri,
|
||||
}
|
||||
|
||||
impl Redirect {
|
||||
pub fn new(count: i8, is_follow: bool, target: Uri) -> Self {
|
||||
Self {
|
||||
count,
|
||||
is_follow,
|
||||
target,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn count(&self) -> &i8 {
|
||||
&self.count
|
||||
}
|
||||
|
||||
pub fn is_follow(&self) -> &bool {
|
||||
&self.is_follow
|
||||
}
|
||||
|
||||
pub fn target(&self) -> &Uri {
|
||||
&self.target
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue