mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
26 lines
556 B
Rust
26 lines
556 B
Rust
use std::{borrow::Cow, sync::Arc};
|
|
|
|
use yazi_config::plugin::Preloader;
|
|
use yazi_shared::Id;
|
|
|
|
use crate::{TaskIn, preload::PreloadProg};
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub(crate) struct PreloadIn {
|
|
pub(crate) id: Id,
|
|
pub(crate) preloader: Arc<Preloader>,
|
|
pub(crate) target: yazi_fs::File,
|
|
}
|
|
|
|
impl TaskIn for PreloadIn {
|
|
type Prog = PreloadProg;
|
|
|
|
fn id(&self) -> Id { self.id }
|
|
|
|
fn set_id(&mut self, id: Id) -> &mut Self {
|
|
self.id = id;
|
|
self
|
|
}
|
|
|
|
fn title(&self) -> Cow<'_, str> { format!("Run preloader '{}'", self.preloader.name).into() }
|
|
}
|