mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-24 16:21:04 +00:00
29 lines
625 B
Rust
29 lines
625 B
Rust
use serde::Deserialize;
|
|
use yazi_shared::{event::Cmd, Condition};
|
|
|
|
use crate::{Pattern, Priority};
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct Prefetcher {
|
|
#[serde(skip)]
|
|
pub id: u8,
|
|
pub cond: Option<Condition>,
|
|
pub name: Option<Pattern>,
|
|
pub mime: Option<Pattern>,
|
|
pub run: Cmd,
|
|
#[serde(default)]
|
|
pub prio: Priority,
|
|
}
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub struct PrefetcherProps {
|
|
pub id: u8,
|
|
pub name: String,
|
|
pub prio: Priority,
|
|
}
|
|
|
|
impl From<&Prefetcher> for PrefetcherProps {
|
|
fn from(prefetcher: &Prefetcher) -> Self {
|
|
Self { id: prefetcher.id, name: prefetcher.run.name.to_owned(), prio: prefetcher.prio }
|
|
}
|
|
}
|