mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-03 01:55:27 +00:00
begin multi-driver page client implementation
This commit is contained in:
parent
df8dea9534
commit
0c08a0fb2f
39 changed files with 741 additions and 1712 deletions
42
src/app/browser/window/tab/item/client/feature.rs
Normal file
42
src/app/browser/window/tab/item/client/feature.rs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
// Feature conversion prefixes
|
||||
const DOWNLOAD: &str = "download:";
|
||||
const SOURCE: &str = "source:";
|
||||
|
||||
/// Feature wrapper for client `Request`
|
||||
#[derive(Default)]
|
||||
pub enum Feature {
|
||||
#[default]
|
||||
Default,
|
||||
Download,
|
||||
Source,
|
||||
// @TODO System(Action)
|
||||
}
|
||||
|
||||
impl Feature {
|
||||
// Constructors
|
||||
|
||||
/// Parse new `Self` from navigation entry request
|
||||
pub fn parse(request: &str) -> (Self, &str) {
|
||||
if let Some(postfix) = request.strip_prefix(DOWNLOAD) {
|
||||
return (Self::Download, postfix);
|
||||
}
|
||||
|
||||
if let Some(postfix) = request.strip_prefix(SOURCE) {
|
||||
return (Self::Source, postfix);
|
||||
}
|
||||
|
||||
(Self::Default, request)
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
/* @TODO not in use
|
||||
/// Get `Self` as prefix
|
||||
pub fn as_prefix(&self) -> Option<&str> {
|
||||
match self {
|
||||
Self::Download => Some(DOWNLOAD),
|
||||
Self::Source => Some(SOURCE),
|
||||
Self::Default => None,
|
||||
}
|
||||
}*/
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue