#![allow(dead_code, unused_variables)]
use std::path::PathBuf;
use std::sync::Arc;
use anyhow::{bail, Result};
use async_std::task::JoinHandle;
use futures::channel::mpsc::Sender;
use indicatif::ProgressBar;
use nipper::{Document, Selection};
use super::TrunkLinkPipelineOutput;
use crate::config::{CargoMetadata, RtcBuild};
pub struct RustWorker {
id: usize,
cfg: Arc<RtcBuild>,
progress: ProgressBar,
manifest: CargoMetadata,
ignore_chan: Option<Sender<PathBuf>>,
}
impl RustWorker {
pub const TYPE_RUST_WORKER: &'static str = "rust-worker";
pub async fn new(
cfg: Arc<RtcBuild>, progress: ProgressBar, html_dir: Arc<PathBuf>, ignore_chan: Option<Sender<PathBuf>>, el: Selection<'_>, id: usize,
) -> Result<Self> {
bail!(r#"the rust web worker asset type `<link data-trunk rel="rust-worker" .../>` is not yet supported"#)
}
pub fn spawn(self) -> JoinHandle<Result<TrunkLinkPipelineOutput>> {
unimplemented!()
}
}
pub struct RustWorkerOutput {
pub id: Option<usize>,
pub cfg: Arc<RtcBuild>,
pub js_output: String,
pub wasm_output: String,
}
impl RustWorkerOutput {
pub async fn finalize(self, dom: &mut Document) -> Result<()> {
unimplemented!()
}
}